예제 #1
0
        public async Task <Response <ContainerAppReplicaData> > GetReplicaAsync(string subscriptionId, string resourceGroupName, string containerAppName, string revisionName, string replicaName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName));
            Argument.AssertNotNullOrEmpty(revisionName, nameof(revisionName));
            Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName));

            using var message = CreateGetReplicaRequest(subscriptionId, resourceGroupName, containerAppName, revisionName, replicaName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                ContainerAppReplicaData value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = ContainerAppReplicaData.DeserializeContainerAppReplicaData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
예제 #2
0
 internal ContainerAppReplicaResource(ArmClient client, ContainerAppReplicaData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }