-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathazure.containerregistry.ContainerRegistryClient.yml
More file actions
474 lines (463 loc) · 20.1 KB
/
azure.containerregistry.ContainerRegistryClient.yml
File metadata and controls
474 lines (463 loc) · 20.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
### YamlMime:PythonClass
uid: azure.containerregistry.ContainerRegistryClient
name: ContainerRegistryClient
fullName: azure.containerregistry.ContainerRegistryClient
module: azure.containerregistry
inheritances:
- azure.containerregistry._base_client.ContainerRegistryBaseClient
summary: Create a ContainerRegistryClient from an ACR endpoint and a credential.
constructor:
syntax: 'ContainerRegistryClient(endpoint: str, credential: TokenCredential | None
= None, *, api_version: str | None = None, audience: str = ''https://containerregistry.azure.net'',
**kwargs)'
parameters:
- name: endpoint
description: An ACR endpoint.
isRequired: true
types:
- <xref:str>
- name: credential
description: The credential with which to authenticate. This should be None in
anonymous access.
defaultValue: None
types:
- <xref:azure.core.credentials.TokenCredential>
- <xref:None>
keywordOnlyParameters:
- name: api_version
description: API Version. The default value is "2021-07-01".
types:
- <xref:str>
- name: audience
description: 'URL to use for credential authentication with AAD. Its value could
be
"`https://management.azure.com`", "[https://management.chinacloudapi.cn](https://management.chinacloudapi.cn)"
or
"[https://management.usgovcloudapi.net](https://management.usgovcloudapi.net)".
The default value is "[https://containerregistry.azure.net](https://containerregistry.azure.net)".'
defaultValue: https://containerregistry.azure.net
types:
- <xref:str>
examples:
- "Instantiate an instance of *ContainerRegistryClient*<!--[!code-python[Main](les\\\
sample_hello_world.py )]-->\n\n<!-- literal_block {\"ids\": [], \"classes\": [],\
\ \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\": \"C:\\\\hostedtoolcache\\\
\\windows\\\\Python\\\\3.11.9\\\\x64\\\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\
\\34\\\\azure-containerregistry-1.2.0\\\\samples\\\\sample_hello_world.py\", \"\
xml:space\": \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n with ContainerRegistryClient(self.endpoint,\
\ self.credential) as client:\n\n ````\n"
methods:
- uid: azure.containerregistry.ContainerRegistryClient.close
name: close
summary: 'Close sockets opened by the client.
Calling this method is unnecessary when using the client as a context manager.'
signature: close() -> None
- uid: azure.containerregistry.ContainerRegistryClient.delete_blob
name: delete_blob
summary: "Delete a blob. If the blob cannot be found or a response status code of\n\
404 is returned an error will not be raised.\n\nExample\n\n<!-- literal_block\
\ {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\"\
: [], \"xml:space\": \"preserve\", \"force\": false, \"language\": \"python\"\
, \"highlight_args\": {}, \"linenos\": false} -->\n\n````python\n\n from azure.containerregistry\
\ import ContainerRegistryClient\n from azure.identity import DefaultAzureCredential\n\
\ endpoint = os.environ[\"CONTAINERREGISTRY_ENDPOINT\"]\n client = ContainerRegistryClient(endpoint,\
\ DefaultAzureCredential(), audience=\"my_audience\")\n client.delete_blob(\"\
my_repository\", \"my_digest\")\n ````"
signature: 'delete_blob(repository: str, digest: str, **kwargs) -> None'
parameters:
- name: repository
description: Name of the repository the manifest belongs to
isRequired: true
types:
- <xref:str>
- name: digest
description: Digest of the blob to be deleted
isRequired: true
types:
- <xref:str>
return:
description: None
- uid: azure.containerregistry.ContainerRegistryClient.delete_manifest
name: delete_manifest
summary: "Delete a manifest. If the manifest cannot be found or a response status\
\ code of\n404 is returned an error will not be raised.\n\nExample\n\n<!-- literal_block\
\ {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\"\
: [], \"xml:space\": \"preserve\", \"force\": false, \"language\": \"python\"\
, \"highlight_args\": {}, \"linenos\": false} -->\n\n````python\n\n from azure.containerregistry\
\ import ContainerRegistryClient\n from azure.identity import DefaultAzureCredential\n\
\ endpoint = os.environ[\"CONTAINERREGISTRY_ENDPOINT\"]\n client = ContainerRegistryClient(endpoint,\
\ DefaultAzureCredential(), audience=\"my_audience\")\n client.delete_manifest(\"\
my_repository\", \"my_tag_or_digest\")\n ````"
signature: 'delete_manifest(repository: str, tag_or_digest: str, **kwargs) -> None'
parameters:
- name: repository
description: Name of the repository the manifest belongs to
isRequired: true
types:
- <xref:str>
- name: tag_or_digest
description: Tag or digest of the manifest to be deleted
isRequired: true
types:
- <xref:str>
return:
description: None
exceptions:
- type: azure.core.exceptions.HttpResponseError
- uid: azure.containerregistry.ContainerRegistryClient.delete_repository
name: delete_repository
summary: 'Delete a repository. If the repository cannot be found or a response status
code of
404 is returned an error will not be raised.'
signature: 'delete_repository(repository: str, **kwargs) -> None'
parameters:
- name: repository
description: The repository to delete
isRequired: true
types:
- <xref:str>
return:
description: None
types:
- <xref:None>
exceptions:
- type: azure.core.exceptions.HttpResponseError
examples:
- "Delete a repository from the *ContainerRegistryClient*<!--[!code-python[Main](les\\\
sample_hello_world.py )]-->\n\n<!-- literal_block {\"ids\": [], \"classes\": [],\
\ \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\": \"C:\\\\hostedtoolcache\\\
\\windows\\\\Python\\\\3.11.9\\\\x64\\\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\
\\34\\\\azure-containerregistry-1.2.0\\\\samples\\\\sample_hello_world.py\", \"\
xml:space\": \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n \
\ client.delete_repository(repository_name)\n\n ````\n"
- uid: azure.containerregistry.ContainerRegistryClient.delete_tag
name: delete_tag
summary: "Delete a tag from a repository. If the tag cannot be found or a response\
\ status code of\n404 is returned an error will not be raised.\n\nExample\n\n\
<!-- literal_block {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\"\
: [], \"backrefs\": [], \"xml:space\": \"preserve\", \"force\": false, \"language\"\
: \"python\", \"highlight_args\": {}, \"linenos\": false} -->\n\n````python\n\n\
\ from azure.containerregistry import ContainerRegistryClient\n from azure.identity\
\ import DefaultAzureCredential\n endpoint = os.environ[\"CONTAINERREGISTRY_ENDPOINT\"\
]\n client = ContainerRegistryClient(endpoint, DefaultAzureCredential(), audience=\"\
my_audience\")\n for tag in client.list_tag_properties(\"my_repository\"):\n\
\ client.delete_tag(\"my_repository\", tag.name)\n ````"
signature: 'delete_tag(repository: str, tag: str, **kwargs) -> None'
parameters:
- name: repository
description: Name of the repository the tag belongs to
isRequired: true
types:
- <xref:str>
- name: tag
description: The tag to be deleted
isRequired: true
types:
- <xref:str>
return:
description: None
types:
- <xref:None>
exceptions:
- type: azure.core.exceptions.HttpResponseError
- uid: azure.containerregistry.ContainerRegistryClient.download_blob
name: download_blob
summary: Download a blob that is part of an artifact to a stream.
signature: 'download_blob(repository: str, digest: str, **kwargs) -> DownloadBlobStream'
parameters:
- name: repository
description: Name of the repository.
isRequired: true
types:
- <xref:str>
- name: digest
description: The digest of the blob to download.
isRequired: true
types:
- <xref:str>
return:
description: DownloadBlobStream
types:
- <xref:azure.containerregistry.DownloadBlobStream>
exceptions:
- type: azure.containerregistry.DigestValidationError
description: If the content of retrieved blob digest does not match the requested
digest.
- type: ValueError
description: If the content-range header is missing or invalid in response.
- uid: azure.containerregistry.ContainerRegistryClient.get_manifest
name: get_manifest
summary: Get the manifest for an artifact.
signature: 'get_manifest(repository: str, tag_or_digest: str, **kwargs) -> GetManifestResult'
parameters:
- name: repository
description: Name of the repository.
isRequired: true
types:
- <xref:str>
- name: tag_or_digest
description: 'The tag or digest of the manifest to get.
When digest is provided, will use this digest to compare with the one calculated
by the response payload.
When tag is provided, will use the digest in response headers to compare.'
isRequired: true
types:
- <xref:str>
return:
description: GetManifestResult
types:
- <xref:azure.containerregistry.GetManifestResult>
exceptions:
- type: azure.containerregistry.DigestValidationError
description: 'If the content of retrieved manifest digest does not match the requested
digest, or
the server-computed digest does not match the client-computed digest when tag
is passing.'
- type: ValueError
description: 'If the content-length header is missing or invalid in response,
or the manifest size is
bigger than 4MB.'
- uid: azure.containerregistry.ContainerRegistryClient.get_manifest_properties
name: get_manifest_properties
summary: "Get the properties of a registry artifact\n\nExample\n\n<!-- literal_block\
\ {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\"\
: [], \"xml:space\": \"preserve\", \"force\": false, \"language\": \"python\"\
, \"highlight_args\": {}, \"linenos\": false} -->\n\n````python\n\n from azure.containerregistry\
\ import ContainerRegistryClient\n from azure.identity import DefaultAzureCredential\n\
\ endpoint = os.environ[\"CONTAINERREGISTRY_ENDPOINT\"]\n client = ContainerRegistryClient(endpoint,\
\ DefaultAzureCredential(), audience=\"my_audience\")\n for artifact in client.list_manifest_properties(\"\
my_repository\"):\n properties = client.get_manifest_properties(\"my_repository\"\
, artifact.digest)\n ````"
signature: 'get_manifest_properties(repository: str, tag_or_digest: str, **kwargs)
-> ArtifactManifestProperties'
parameters:
- name: repository
description: Name of the repository
isRequired: true
types:
- <xref:str>
- name: tag_or_digest
description: Tag or digest of the manifest
isRequired: true
types:
- <xref:str>
return:
description: The properties of a registry artifact
types:
- <xref:azure.containerregistry.ArtifactManifestProperties>
exceptions:
- type: azure.core.exceptions.ResourceNotFoundError
- uid: azure.containerregistry.ContainerRegistryClient.get_repository_properties
name: get_repository_properties
summary: Get the properties of a repository
signature: 'get_repository_properties(repository: str, **kwargs) -> RepositoryProperties'
parameters:
- name: repository
description: Name of the repository
isRequired: true
types:
- <xref:str>
return:
description: The properties of a repository
types:
- <xref:azure.containerregistry.RepositoryProperties>
exceptions:
- type: azure.core.exceptions.ResourceNotFoundError
- uid: azure.containerregistry.ContainerRegistryClient.get_tag_properties
name: get_tag_properties
summary: "Get the properties for a tag\n\nExample\n\n<!-- literal_block {\"ids\"\
: [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\": [], \"xml:space\"\
: \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {}, \"linenos\": false} -->\n\n````python\n\n from azure.containerregistry\
\ import ContainerRegistryClient\n from azure.identity import DefaultAzureCredential\n\
\ endpoint = os.environ[\"CONTAINERREGISTRY_ENDPOINT\"]\n client = ContainerRegistryClient(endpoint,\
\ DefaultAzureCredential(), audience=\"my_audience\")\n for tag in client.list_tag_properties(\"\
my_repository\"):\n tag_properties = client.get_tag_properties(\"my_repository\"\
, tag.name)\n ````"
signature: 'get_tag_properties(repository: str, tag: str, **kwargs) -> ArtifactTagProperties'
parameters:
- name: repository
description: Name of the repository
isRequired: true
types:
- <xref:str>
- name: tag
description: The tag to get tag properties for
isRequired: true
types:
- <xref:str>
return:
description: The properties for a tag
types:
- <xref:azure.containerregistry.ArtifactTagProperties>
exceptions:
- type: azure.core.exceptions.ResourceNotFoundError
- uid: azure.containerregistry.ContainerRegistryClient.list_manifest_properties
name: list_manifest_properties
summary: List the artifacts for a repository
signature: 'list_manifest_properties(repository: str, **kwargs) -> ItemPaged[ArtifactManifestProperties]'
parameters:
- name: repository
description: Name of the repository
isRequired: true
types:
- <xref:str>
keywordOnlyParameters:
- name: order_by
description: Query parameter for ordering by time ascending or descending
types:
- <xref:azure.containerregistry.ArtifactManifestOrder>
- <xref:str>
- name: results_per_page
description: Number of repositories to return per page
types:
- <xref:int>
return:
description: An iterable of <xref:azure.containerregistry.ArtifactManifestProperties>
types:
- <xref:azure.core.paging.ItemPaged>[<xref:azure.containerregistry.ArtifactManifestProperties>]
exceptions:
- type: azure.core.exceptions.ResourceNotFoundError
- uid: azure.containerregistry.ContainerRegistryClient.list_repository_names
name: list_repository_names
summary: List all repositories
signature: list_repository_names(**kwargs) -> ItemPaged[str]
keywordOnlyParameters:
- name: results_per_page
description: Number of repositories to return per page
types:
- <xref:int>
return:
description: An iterable of strings
types:
- <xref:azure.core.paging.ItemPaged>[<xref:str>]
exceptions:
- type: azure.core.exceptions.HttpResponseError
examples:
- "List repositories in a container registry account<!--[!code-python[Main](les\\\
sample_delete_tags.py )]-->\n\n<!-- literal_block {\"ids\": [], \"classes\": [],\
\ \"names\": [], \"dupnames\": [], \"backrefs\": [], \"source\": \"C:\\\\hostedtoolcache\\\
\\windows\\\\Python\\\\3.11.9\\\\x64\\\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\
\\34\\\\azure-containerregistry-1.2.0\\\\samples\\\\sample_delete_tags.py\", \"\
xml:space\": \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {\"linenostart\": 1}, \"linenos\": false} -->\n\n````python\n\n with ContainerRegistryClient(self.endpoint,\
\ self.credential) as client:\n # Iterate through all the repositories\n\
\ for repository_name in client.list_repository_names():\n print(repository_name)\n\
\n ````\n"
- uid: azure.containerregistry.ContainerRegistryClient.list_tag_properties
name: list_tag_properties
summary: "List the tags for a repository\n\nExample\n\n<!-- literal_block {\"ids\"\
: [], \"classes\": [], \"names\": [], \"dupnames\": [], \"backrefs\": [], \"xml:space\"\
: \"preserve\", \"force\": false, \"language\": \"python\", \"highlight_args\"\
: {}, \"linenos\": false} -->\n\n````python\n\n from azure.containerregistry\
\ import ContainerRegistryClient\n from azure.identity import DefaultAzureCredential\n\
\ endpoint = os.environ[\"CONTAINERREGISTRY_ENDPOINT\"]\n client = ContainerRegistryClient(endpoint,\
\ DefaultAzureCredential(), audience=\"my_audience\")\n for tag in client.list_tag_properties(\"\
my_repository\"):\n tag_properties = client.get_tag_properties(\"my_repository\"\
, tag.name)\n ````"
signature: 'list_tag_properties(repository: str, **kwargs) -> ItemPaged[ArtifactTagProperties]'
parameters:
- name: repository
description: Name of the repository
isRequired: true
types:
- <xref:str>
keywordOnlyParameters:
- name: order_by
description: Query parameter for ordering by time ascending or descending
types:
- <xref:azure.containerregistry.ArtifactTagOrder>
- <xref:str>
- name: results_per_page
description: Number of repositories to return per page
types:
- <xref:int>
return:
description: An iterable of <xref:azure.containerregistry.ArtifactTagProperties>
types:
- <xref:azure.core.paging.ItemPaged>[<xref:azure.containerregistry.ArtifactTagProperties>]
exceptions:
- type: azure.core.exceptions.ResourceNotFoundError
- uid: azure.containerregistry.ContainerRegistryClient.set_manifest
name: set_manifest
summary: Set a manifest for an artifact.
signature: 'set_manifest(repository: str, manifest: MutableMapping[str, Any] | IO[bytes],
*, tag: str | None = None, media_type: str = ''application/vnd.oci.image.manifest.v1+json'',
**kwargs) -> str'
parameters:
- name: repository
description: Name of the repository
isRequired: true
types:
- <xref:str>
- name: manifest
description: The manifest to set. It can be a JSON formatted dict or seekable
stream.
isRequired: true
types:
- <xref:dict>
- <xref:typing.IO>
keywordOnlyParameters:
- name: tag
description: Tag of the manifest.
types:
- <xref:str>
- <xref:None>
- name: media_type
description: 'The media type of the manifest. If not specified, this value will
be set to
a default value of "application/vnd.oci.image.manifest.v1+json". Note: the current
known media types are:
"application/vnd.oci.image.manifest.v1+json", and "application/vnd.docker.distribution.manifest.v2+json".'
types:
- <xref:str>
return:
description: The digest of the set manifest, calculated by the registry.
types:
- <xref:str>
exceptions:
- type: ValueError
description: If the parameter repository or manifest is None.
- type: azure.containerregistry.DigestValidationError
description: If the server-computed digest does not match the client-computed
digest.
- uid: azure.containerregistry.ContainerRegistryClient.update_manifest_properties
name: update_manifest_properties
signature: 'update_manifest_properties(repository: str, tag_or_digest: str, properties:
ArtifactManifestProperties, **kwargs) -> ArtifactManifestProperties'
- uid: azure.containerregistry.ContainerRegistryClient.update_repository_properties
name: update_repository_properties
signature: 'update_repository_properties(repository: str, properties: RepositoryProperties,
**kwargs) -> RepositoryProperties'
- uid: azure.containerregistry.ContainerRegistryClient.update_tag_properties
name: update_tag_properties
signature: 'update_tag_properties(repository: str, tag: str, properties: ArtifactTagProperties,
**kwargs) -> ArtifactTagProperties'
- uid: azure.containerregistry.ContainerRegistryClient.upload_blob
name: upload_blob
summary: Upload an artifact blob.
signature: 'upload_blob(repository: str, data: IO[bytes], **kwargs) -> Tuple[str,
int]'
parameters:
- name: repository
description: Name of the repository.
isRequired: true
types:
- <xref:str>
- name: data
description: 'The blob to upload. Note: This must be a seekable stream.'
isRequired: true
types:
- <xref:typing.IO>
return:
description: The digest and size in bytes of the uploaded blob.
types:
- <xref:typing.Tuple>[<xref:str>, <xref:int>]
exceptions:
- type: ValueError
description: If the parameter repository or data is None.
- type: azure.containerregistry.DigestValidationError
description: If the server-computed digest does not match the client-computed
digest.