Patches a Container App using JSON Merge Patch. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); - - /** - * Update properties of a Container App - * - *
Patches a Container App using JSON Merge Patch.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param containerAppName Name of the Container App.
- * @param containerAppEnvelope Properties of a Container App that need to be updated.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request
- * is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- */
- void update(
- String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context);
-
/**
* Analyzes a custom hostname for a Container App.
*
diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java
index 313f77bd226b..e12a345ab887 100644
--- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java
+++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java
@@ -7,7 +7,6 @@
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner;
/** Resource collection API of ManagedEnvironments. */
public interface ManagedEnvironments {
@@ -127,38 +126,6 @@ Response Patches a Managed Environment using JSON Merge Patch.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param environmentName Name of the Environment.
- * @param environmentEnvelope Configuration details of the Environment.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request
- * is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- */
- void update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope);
-
- /**
- * Update Managed Environment's properties.
- *
- * Patches a Managed Environment using JSON Merge Patch.
- *
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
- * @param environmentName Name of the Environment.
- * @param environmentEnvelope Configuration details of the Environment.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request
- * is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- */
- void update(
- String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context);
-
/**
* Get auth token for a managed environment
*
diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java
index 7c693a2a1f80..fc7c8a2a8b28 100644
--- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java
+++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java
@@ -5,12 +5,12 @@
package com.azure.resourcemanager.appcontainers.generated;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner;
import com.azure.resourcemanager.appcontainers.models.Action;
import com.azure.resourcemanager.appcontainers.models.AppProtocol;
import com.azure.resourcemanager.appcontainers.models.BindingType;
import com.azure.resourcemanager.appcontainers.models.Configuration;
import com.azure.resourcemanager.appcontainers.models.Container;
+import com.azure.resourcemanager.appcontainers.models.ContainerApp;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem;
@@ -42,113 +42,108 @@ public final class ContainerAppsUpdateSamples {
* @param manager Entry point to ContainerAppsApiManager.
*/
public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
- manager
- .containerApps()
- .update(
- "rg",
- "testcontainerApp0",
- new ContainerAppInner()
- .withLocation("East US")
- .withTags(mapOf("tag1", "value1", "tag2", "value2"))
- .withConfiguration(
- new Configuration()
- .withIngress(
- new Ingress()
- .withExternal(true)
- .withTargetPort(3000)
- .withTraffic(
- Arrays
- .asList(
- new TrafficWeight()
- .withRevisionName("testcontainerApp0-ab1234")
- .withWeight(100)
- .withLabel("production")))
- .withCustomDomains(
- Arrays
- .asList(
- new CustomDomain()
- .withName("www.my-name.com")
- .withBindingType(BindingType.SNI_ENABLED)
- .withCertificateId(
- "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
- new CustomDomain()
- .withName("www.my-other-name.com")
- .withBindingType(BindingType.SNI_ENABLED)
- .withCertificateId(
- "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))
- .withIpSecurityRestrictions(
- Arrays
- .asList(
- new IpSecurityRestrictionRule()
- .withName("Allow work IP A subnet")
- .withDescription(
- "Allowing all IP's within the subnet below to access"
- + " containerapp")
- .withIpAddressRange("192.168.1.1/32")
- .withAction(Action.ALLOW),
- new IpSecurityRestrictionRule()
- .withName("Allow work IP B subnet")
- .withDescription(
- "Allowing all IP's within the subnet below to access"
- + " containerapp")
- .withIpAddressRange("192.168.1.1/8")
- .withAction(Action.ALLOW))))
- .withDapr(
- new Dapr()
- .withEnabled(true)
- .withAppProtocol(AppProtocol.HTTP)
- .withAppPort(3000)
- .withHttpReadBufferSize(30)
- .withHttpMaxRequestSize(10)
- .withLogLevel(LogLevel.DEBUG)
- .withEnableApiLogging(true))
- .withMaxInactiveRevisions(10))
- .withTemplate(
- new Template()
- .withInitContainers(
+ ContainerApp resource =
+ manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE).getValue();
+ resource
+ .update()
+ .withTags(mapOf("tag1", "value1", "tag2", "value2"))
+ .withConfiguration(
+ new Configuration()
+ .withIngress(
+ new Ingress()
+ .withExternal(true)
+ .withTargetPort(3000)
+ .withTraffic(
+ Arrays
+ .asList(
+ new TrafficWeight()
+ .withRevisionName("testcontainerApp0-ab1234")
+ .withWeight(100)
+ .withLabel("production")))
+ .withCustomDomains(
Arrays
.asList(
- new InitContainer()
- .withImage("repo/testcontainerApp0:v4")
- .withName("testinitcontainerApp0")
- .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi"))))
- .withContainers(
+ new CustomDomain()
+ .withName("www.my-name.com")
+ .withBindingType(BindingType.SNI_ENABLED)
+ .withCertificateId(
+ "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
+ new CustomDomain()
+ .withName("www.my-other-name.com")
+ .withBindingType(BindingType.SNI_ENABLED)
+ .withCertificateId(
+ "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))
+ .withIpSecurityRestrictions(
Arrays
.asList(
- new Container()
- .withImage("repo/testcontainerApp0:v1")
- .withName("testcontainerApp0")
- .withProbes(
- Arrays
- .asList(
- new ContainerAppProbe()
- .withHttpGet(
- new ContainerAppProbeHttpGet()
- .withHttpHeaders(
- Arrays
- .asList(
- new ContainerAppProbeHttpGetHttpHeadersItem()
- .withName("Custom-Header")
- .withValue("Awesome")))
- .withPath("/health")
- .withPort(8080))
- .withInitialDelaySeconds(3)
- .withPeriodSeconds(3)
- .withType(Type.LIVENESS)))))
- .withScale(
- new Scale()
- .withMinReplicas(1)
- .withMaxReplicas(5)
- .withRules(
+ new IpSecurityRestrictionRule()
+ .withName("Allow work IP A subnet")
+ .withDescription(
+ "Allowing all IP's within the subnet below to access containerapp")
+ .withIpAddressRange("192.168.1.1/32")
+ .withAction(Action.ALLOW),
+ new IpSecurityRestrictionRule()
+ .withName("Allow work IP B subnet")
+ .withDescription(
+ "Allowing all IP's within the subnet below to access containerapp")
+ .withIpAddressRange("192.168.1.1/8")
+ .withAction(Action.ALLOW))))
+ .withDapr(
+ new Dapr()
+ .withEnabled(true)
+ .withAppProtocol(AppProtocol.HTTP)
+ .withAppPort(3000)
+ .withHttpReadBufferSize(30)
+ .withHttpMaxRequestSize(10)
+ .withLogLevel(LogLevel.DEBUG)
+ .withEnableApiLogging(true))
+ .withMaxInactiveRevisions(10))
+ .withTemplate(
+ new Template()
+ .withInitContainers(
+ Arrays
+ .asList(
+ new InitContainer()
+ .withImage("repo/testcontainerApp0:v4")
+ .withName("testinitcontainerApp0")
+ .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi"))))
+ .withContainers(
+ Arrays
+ .asList(
+ new Container()
+ .withImage("repo/testcontainerApp0:v1")
+ .withName("testcontainerApp0")
+ .withProbes(
Arrays
.asList(
- new ScaleRule()
- .withName("httpscalingrule")
- .withCustom(
- new CustomScaleRule()
- .withType("http")
- .withMetadata(mapOf("concurrentRequests", "50"))))))),
- Context.NONE);
+ new ContainerAppProbe()
+ .withHttpGet(
+ new ContainerAppProbeHttpGet()
+ .withHttpHeaders(
+ Arrays
+ .asList(
+ new ContainerAppProbeHttpGetHttpHeadersItem()
+ .withName("Custom-Header")
+ .withValue("Awesome")))
+ .withPath("/health")
+ .withPort(8080))
+ .withInitialDelaySeconds(3)
+ .withPeriodSeconds(3)
+ .withType(Type.LIVENESS)))))
+ .withScale(
+ new Scale()
+ .withMinReplicas(1)
+ .withMaxReplicas(5)
+ .withRules(
+ Arrays
+ .asList(
+ new ScaleRule()
+ .withName("httpscalingrule")
+ .withCustom(
+ new CustomScaleRule()
+ .withType("http")
+ .withMetadata(mapOf("concurrentRequests", "50")))))))
+ .apply();
}
@SuppressWarnings("unchecked")
diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java
index 99932fc462a6..c7884d02e86d 100644
--- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java
+++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java
@@ -5,7 +5,7 @@
package com.azure.resourcemanager.appcontainers.generated;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner;
+import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment;
import java.util.HashMap;
import java.util.Map;
@@ -21,15 +21,12 @@ public final class ManagedEnvironmentsUpdateSamples {
*/
public static void patchManagedEnvironment(
com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) {
- manager
- .managedEnvironments()
- .update(
- "examplerg",
- "testcontainerenv",
- new ManagedEnvironmentInner()
- .withLocation("East US")
- .withTags(mapOf("tag1", "value1", "tag2", "value2")),
- Context.NONE);
+ ManagedEnvironment resource =
+ manager
+ .managedEnvironments()
+ .getByResourceGroupWithResponse("examplerg", "testcontainerenv", Context.NONE)
+ .getValue();
+ resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply();
}
@SuppressWarnings("unchecked")