| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.ContainerRegistry |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Models; |
| | 16 | | using System.IO; |
| | 17 | | using System.Threading; |
| | 18 | | using System.Threading.Tasks; |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Extension methods for BlobOperations. |
| | 22 | | /// </summary> |
| | 23 | | public static partial class BlobOperationsExtensions |
| | 24 | | { |
| | 25 | | /// <summary> |
| | 26 | | /// Retrieve the blob from the registry identified by digest. |
| | 27 | | /// </summary> |
| | 28 | | /// <param name='operations'> |
| | 29 | | /// The operations group for this extension method. |
| | 30 | | /// </param> |
| | 31 | | /// <param name='name'> |
| | 32 | | /// Name of the image (including the namespace) |
| | 33 | | /// </param> |
| | 34 | | /// <param name='digest'> |
| | 35 | | /// Digest of a BLOB |
| | 36 | | /// </param> |
| | 37 | | /// <param name='cancellationToken'> |
| | 38 | | /// The cancellation token. |
| | 39 | | /// </param> |
| | 40 | | public static async Task<Stream> GetAsync(this IBlobOperations operations, string name, string digest, Cance |
| | 41 | | { |
| 6 | 42 | | var _result = await operations.GetWithHttpMessagesAsync(name, digest, null, cancellationToken).Configure |
| 6 | 43 | | _result.Request.Dispose(); |
| 6 | 44 | | return _result.Body; |
| 6 | 45 | | } |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Same as GET, except only the headers are returned. |
| | 49 | | /// </summary> |
| | 50 | | /// <param name='operations'> |
| | 51 | | /// The operations group for this extension method. |
| | 52 | | /// </param> |
| | 53 | | /// <param name='name'> |
| | 54 | | /// Name of the image (including the namespace) |
| | 55 | | /// </param> |
| | 56 | | /// <param name='digest'> |
| | 57 | | /// Digest of a BLOB |
| | 58 | | /// </param> |
| | 59 | | /// <param name='cancellationToken'> |
| | 60 | | /// The cancellation token. |
| | 61 | | /// </param> |
| | 62 | | public static async Task<BlobCheckHeaders> CheckAsync(this IBlobOperations operations, string name, string d |
| | 63 | | { |
| 4 | 64 | | using (var _result = await operations.CheckWithHttpMessagesAsync(name, digest, null, cancellationToken). |
| | 65 | | { |
| 2 | 66 | | return _result.Headers; |
| | 67 | | } |
| 2 | 68 | | } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Removes an already uploaded blob. |
| | 72 | | /// </summary> |
| | 73 | | /// <param name='operations'> |
| | 74 | | /// The operations group for this extension method. |
| | 75 | | /// </param> |
| | 76 | | /// <param name='name'> |
| | 77 | | /// Name of the image (including the namespace) |
| | 78 | | /// </param> |
| | 79 | | /// <param name='digest'> |
| | 80 | | /// Digest of a BLOB |
| | 81 | | /// </param> |
| | 82 | | /// <param name='cancellationToken'> |
| | 83 | | /// The cancellation token. |
| | 84 | | /// </param> |
| | 85 | | public static async Task<Stream> DeleteAsync(this IBlobOperations operations, string name, string digest, Ca |
| | 86 | | { |
| 2 | 87 | | var _result = await operations.DeleteWithHttpMessagesAsync(name, digest, null, cancellationToken).Config |
| 2 | 88 | | _result.Request.Dispose(); |
| 2 | 89 | | return _result.Body; |
| 2 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> |
| | 93 | | /// Mount a blob identified by the `mount` parameter from another repository. |
| | 94 | | /// </summary> |
| | 95 | | /// <param name='operations'> |
| | 96 | | /// The operations group for this extension method. |
| | 97 | | /// </param> |
| | 98 | | /// <param name='name'> |
| | 99 | | /// Name of the image (including the namespace) |
| | 100 | | /// </param> |
| | 101 | | /// <param name='fromParameter'> |
| | 102 | | /// Name of the source repository. |
| | 103 | | /// </param> |
| | 104 | | /// <param name='mount'> |
| | 105 | | /// Digest of blob to mount from the source repository. |
| | 106 | | /// </param> |
| | 107 | | /// <param name='cancellationToken'> |
| | 108 | | /// The cancellation token. |
| | 109 | | /// </param> |
| | 110 | | public static async Task<BlobMountHeaders> MountAsync(this IBlobOperations operations, string name, string f |
| | 111 | | { |
| 2 | 112 | | using (var _result = await operations.MountWithHttpMessagesAsync(name, fromParameter, mount, null, cance |
| | 113 | | { |
| 2 | 114 | | return _result.Headers; |
| | 115 | | } |
| 2 | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> |
| | 119 | | /// Retrieve status of upload identified by uuid. The primary purpose of this |
| | 120 | | /// endpoint is to resolve the current status of a resumable upload. |
| | 121 | | /// </summary> |
| | 122 | | /// <param name='operations'> |
| | 123 | | /// The operations group for this extension method. |
| | 124 | | /// </param> |
| | 125 | | /// <param name='location'> |
| | 126 | | /// Link acquired from upload start or previous chunk. Note, do not include |
| | 127 | | /// initial / (must do substring(1) ) |
| | 128 | | /// </param> |
| | 129 | | /// <param name='cancellationToken'> |
| | 130 | | /// The cancellation token. |
| | 131 | | /// </param> |
| | 132 | | public static async Task<BlobGetStatusHeaders> GetStatusAsync(this IBlobOperations operations, string locati |
| | 133 | | { |
| 2 | 134 | | using (var _result = await operations.GetStatusWithHttpMessagesAsync(location, null, cancellationToken). |
| | 135 | | { |
| 2 | 136 | | return _result.Headers; |
| | 137 | | } |
| 2 | 138 | | } |
| | 139 | |
|
| | 140 | | /// <summary> |
| | 141 | | /// Upload a stream of data without completing the upload. |
| | 142 | | /// </summary> |
| | 143 | | /// <param name='operations'> |
| | 144 | | /// The operations group for this extension method. |
| | 145 | | /// </param> |
| | 146 | | /// <param name='value'> |
| | 147 | | /// Raw data of blob |
| | 148 | | /// </param> |
| | 149 | | /// <param name='location'> |
| | 150 | | /// Link acquired from upload start or previous chunk. Note, do not include |
| | 151 | | /// initial / (must do substring(1) ) |
| | 152 | | /// </param> |
| | 153 | | /// <param name='cancellationToken'> |
| | 154 | | /// The cancellation token. |
| | 155 | | /// </param> |
| | 156 | | public static async Task<BlobUploadHeaders> UploadAsync(this IBlobOperations operations, Stream value, strin |
| | 157 | | { |
| 4 | 158 | | using (var _result = await operations.UploadWithHttpMessagesAsync(value, location, null, cancellationTok |
| | 159 | | { |
| 4 | 160 | | return _result.Headers; |
| | 161 | | } |
| 4 | 162 | | } |
| | 163 | |
|
| | 164 | | /// <summary> |
| | 165 | | /// Complete the upload, providing all the data in the body, if necessary. A |
| | 166 | | /// request without a body will just complete the upload with previously |
| | 167 | | /// uploaded content. |
| | 168 | | /// </summary> |
| | 169 | | /// <param name='operations'> |
| | 170 | | /// The operations group for this extension method. |
| | 171 | | /// </param> |
| | 172 | | /// <param name='digest'> |
| | 173 | | /// Digest of a BLOB |
| | 174 | | /// </param> |
| | 175 | | /// <param name='location'> |
| | 176 | | /// Link acquired from upload start or previous chunk. Note, do not include |
| | 177 | | /// initial / (must do substring(1) ) |
| | 178 | | /// </param> |
| | 179 | | /// <param name='value'> |
| | 180 | | /// Optional raw data of blob |
| | 181 | | /// </param> |
| | 182 | | /// <param name='cancellationToken'> |
| | 183 | | /// The cancellation token. |
| | 184 | | /// </param> |
| | 185 | | public static async Task<BlobEndUploadHeaders> EndUploadAsync(this IBlobOperations operations, string digest |
| | 186 | | { |
| 4 | 187 | | using (var _result = await operations.EndUploadWithHttpMessagesAsync(digest, location, value, null, canc |
| | 188 | | { |
| 4 | 189 | | return _result.Headers; |
| | 190 | | } |
| 4 | 191 | | } |
| | 192 | |
|
| | 193 | | /// <summary> |
| | 194 | | /// Cancel outstanding upload processes, releasing associated resources. If |
| | 195 | | /// this is not called, the unfinished uploads will eventually timeout. |
| | 196 | | /// </summary> |
| | 197 | | /// <param name='operations'> |
| | 198 | | /// The operations group for this extension method. |
| | 199 | | /// </param> |
| | 200 | | /// <param name='location'> |
| | 201 | | /// Link acquired from upload start or previous chunk. Note, do not include |
| | 202 | | /// initial / (must do substring(1) ) |
| | 203 | | /// </param> |
| | 204 | | /// <param name='cancellationToken'> |
| | 205 | | /// The cancellation token. |
| | 206 | | /// </param> |
| | 207 | | public static async Task CancelUploadAsync(this IBlobOperations operations, string location, CancellationTok |
| | 208 | | { |
| 4 | 209 | | (await operations.CancelUploadWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(fa |
| 4 | 210 | | } |
| | 211 | |
|
| | 212 | | /// <summary> |
| | 213 | | /// Initiate a resumable blob upload with an empty request body. |
| | 214 | | /// </summary> |
| | 215 | | /// <param name='operations'> |
| | 216 | | /// The operations group for this extension method. |
| | 217 | | /// </param> |
| | 218 | | /// <param name='name'> |
| | 219 | | /// Name of the image (including the namespace) |
| | 220 | | /// </param> |
| | 221 | | /// <param name='cancellationToken'> |
| | 222 | | /// The cancellation token. |
| | 223 | | /// </param> |
| | 224 | | public static async Task<BlobStartUploadHeaders> StartUploadAsync(this IBlobOperations operations, string na |
| | 225 | | { |
| 8 | 226 | | using (var _result = await operations.StartUploadWithHttpMessagesAsync(name, null, cancellationToken).Co |
| | 227 | | { |
| 8 | 228 | | return _result.Headers; |
| | 229 | | } |
| 8 | 230 | | } |
| | 231 | |
|
| | 232 | | /// <summary> |
| | 233 | | /// Retrieve the blob from the registry identified by `digest`. This endpoint |
| | 234 | | /// may also support RFC7233 compliant range requests. Support can be detected |
| | 235 | | /// by issuing a HEAD request. If the header `Accept-Range: bytes` is returned, |
| | 236 | | /// range requests can be used to fetch partial content. |
| | 237 | | /// </summary> |
| | 238 | | /// <param name='operations'> |
| | 239 | | /// The operations group for this extension method. |
| | 240 | | /// </param> |
| | 241 | | /// <param name='name'> |
| | 242 | | /// Name of the image (including the namespace) |
| | 243 | | /// </param> |
| | 244 | | /// <param name='digest'> |
| | 245 | | /// Digest of a BLOB |
| | 246 | | /// </param> |
| | 247 | | /// <param name='range'> |
| | 248 | | /// Format : bytes=<start>-<end>, HTTP Range header specifying |
| | 249 | | /// blob chunk. |
| | 250 | | /// </param> |
| | 251 | | /// <param name='cancellationToken'> |
| | 252 | | /// The cancellation token. |
| | 253 | | /// </param> |
| | 254 | | public static async Task<Stream> GetChunkAsync(this IBlobOperations operations, string name, string digest, |
| | 255 | | { |
| 2 | 256 | | var _result = await operations.GetChunkWithHttpMessagesAsync(name, digest, range, null, cancellationToke |
| 2 | 257 | | _result.Request.Dispose(); |
| 2 | 258 | | return _result.Body; |
| 2 | 259 | | } |
| | 260 | |
|
| | 261 | | /// <summary> |
| | 262 | | /// Same as GET, except only the headers are returned. |
| | 263 | | /// </summary> |
| | 264 | | /// <param name='operations'> |
| | 265 | | /// The operations group for this extension method. |
| | 266 | | /// </param> |
| | 267 | | /// <param name='name'> |
| | 268 | | /// Name of the image (including the namespace) |
| | 269 | | /// </param> |
| | 270 | | /// <param name='digest'> |
| | 271 | | /// Digest of a BLOB |
| | 272 | | /// </param> |
| | 273 | | /// <param name='range'> |
| | 274 | | /// Format : bytes=<start>-<end>, HTTP Range header specifying |
| | 275 | | /// blob chunk. |
| | 276 | | /// </param> |
| | 277 | | /// <param name='cancellationToken'> |
| | 278 | | /// The cancellation token. |
| | 279 | | /// </param> |
| | 280 | | public static async Task<BlobCheckChunkHeaders> CheckChunkAsync(this IBlobOperations operations, string name |
| | 281 | | { |
| 2 | 282 | | using (var _result = await operations.CheckChunkWithHttpMessagesAsync(name, digest, range, null, cancell |
| | 283 | | { |
| 2 | 284 | | return _result.Headers; |
| | 285 | | } |
| 2 | 286 | | } |
| | 287 | |
|
| | 288 | | } |
| | 289 | | } |