Skip to content

Commit e91500d

Browse files
authored
[ACR] Update client documentation and a few other changes (Azure#35224)
* Update doc comments on ContainerRegistryContentClient * Update custom manifest samples and CHANGELOG. * Reduce size of large blob for upload/download test to stay under the time limit. * Export API
1 parent be8deca commit e91500d

File tree

7 files changed

+122
-76
lines changed

7 files changed

+122
-76
lines changed

sdk/containerregistry/Azure.Containers.ContainerRegistry/CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,28 @@
44

55
### Features Added
66

7+
- Added a `DownloadStreaming()` method to `ContainerRegistryContentClient`. This method returns a network stream in the returned result that the caller must dispose after use.
8+
- Added overloads to the `DownloadBlobTo()` method that take a file path instead of a Stream.
9+
710
### Breaking Changes
811

9-
### Bugs Fixed
12+
- Renamed `ContainerRegistryBlobClient` to `ContainerRegistryContentClient`.
13+
- Moved `ContainerRegistryContentClient` and related types into main namespace.
14+
- Removed `MaxChunkSize` property from `ContainerRegistryClientOptions`.
15+
- Renamed `ContainerRegistryContentClient.DownloadBlob()` method to `DownloadBlobContent()`.
16+
- Renamed `DownloadBlobResult` to `DownloadRegistryBlobResult`.
17+
- Renamed `UploadBlobResult` to `UploadRegistryBlobResult`.
18+
- Renamed `ContainerRegistryContentClient.DownloadManifest()` to `GetManifest()` and `DownloadManifestResult` to `GetManifestResult`.
19+
- Renamed `ContainerRegistryContentClient.UploadManifest ()` to `SetManifest()` and `UploadManifestResult` to `SetManifestResult`.
20+
- Renamed `GetManifestResult.Content` name to `GetManifestResult.Manifest`.
21+
- Removed `GetManifestResult.AsOciManifest()` method in favor of `BinaryData.ToObjectFromJson<OciImageManifest>()`.
22+
- Changed `Url`, `Source` and `Documentation` properties on `OciAnnotations` type to `Uri` type.
23+
- Renamed `OciAnnotations.Config` to `OciAnnotations.Configuration`.
1024

1125
### Other Changes
1226

27+
- Removed requirement to pass `Audience` property on `ContainerRegistryClientOptions` in order to create any client instance.
28+
1329
## 1.1.0-beta.8 (2023-03-13)
1430

1531
### Features Added

sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public static partial class ContainerRegistryModelFactory
197197
public static Azure.Containers.ContainerRegistry.ContainerRepositoryProperties ContainerRepositoryProperties(string registryLoginServer = null, string name = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), int manifestCount = 0, int tagCount = 0, bool? canDelete = default(bool?), bool? canWrite = default(bool?), bool? canList = default(bool?), bool? canRead = default(bool?)) { throw null; }
198198
public static Azure.Containers.ContainerRegistry.DownloadRegistryBlobResult DownloadRegistryBlobResult(string digest = null, System.BinaryData content = null) { throw null; }
199199
public static Azure.Containers.ContainerRegistry.GetManifestResult GetManifestResult(string digest = null, string mediaType = null, System.BinaryData manifest = null) { throw null; }
200-
public static Azure.Containers.ContainerRegistry.SetManifestResult UploadManifestResult(string digest = null) { throw null; }
200+
public static Azure.Containers.ContainerRegistry.SetManifestResult SetManifestResult(string digest = null) { throw null; }
201201
public static Azure.Containers.ContainerRegistry.UploadRegistryBlobResult UploadRegistryBlobResult(string digest, long sizeInBytes) { throw null; }
202202
}
203203
public partial class ContainerRepository

sdk/containerregistry/Azure.Containers.ContainerRegistry/samples/Sample05_UploadDownloadImage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ An image consists of a manifest file, config file, and one or more layer files.
88

99
## Create Client
1010

11-
Create a `ContainerRegistryBlobClient` for the registry, passing the repository, credentials, and client options.
11+
Create a `ContainerRegistryContentClient` for the registry, passing the repository, credentials, and client options.
1212

13-
```C# Snippet:ContainerRegistry_Samples_CreateBlobClient
13+
```C# Snippet:ContainerRegistry_Samples_CreateContentClient
1414
// Get the service endpoint from the environment
1515
Uri endpoint = new(Environment.GetEnvironmentVariable("REGISTRY_ENDPOINT"));
1616

@@ -105,7 +105,7 @@ static string TrimSha(string digest)
105105
}
106106
```
107107

108-
## Upload a custom manifest
108+
## Upload a Docker manifest
109109

110110
To upload an image with a custom manifest type, pass the `ManifestMediaType` to the `UploadManifest` method.
111111

@@ -114,7 +114,7 @@ To upload an image with a custom manifest type, pass the `ManifestMediaType` to
114114
var manifestList = new
115115
{
116116
schemaVersion = 2,
117-
mediaType = ManifestMediaType.DockerManifestList.ToString(),
117+
mediaType = "application/vnd.docker.distribution.manifest.list.v2+json",
118118
manifests = new[]
119119
{
120120
new
@@ -134,9 +134,9 @@ BinaryData content = BinaryData.FromObjectAsJson(manifestList);
134134
await client.SetManifestAsync(content, tag: "sample", ManifestMediaType.DockerManifestList);
135135
```
136136

137-
## Download a custom manifest
137+
## Download a manifest of an unknown type
138138

139-
To download a manifest of an unknown type, pass possible values to the list of acceptable media types. The media type of the manifest is returned on the `DownloadManifestResult`.
139+
If you are downloading a manifest where the media type isn't known ahead of time, check the `MediaType` property returned on the `DownloadManifestResult` to determine the type.
140140

141141
```C# Snippet:ContainerRegistry_Samples_DownloadCustomManifestAsync
142142
GetManifestResult result = await client.GetManifestAsync("sample");

0 commit comments

Comments
 (0)