diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml b/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml
index 49da3386a3b5c..e370281a0a757 100644
--- a/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml
+++ b/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml
@@ -195,6 +195,8 @@
revapi-maven-plugin
0.11.2
+ true
+
-
diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java
index d7c64d3a004d0..76edfa257c5a2 100644
--- a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java
+++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java
@@ -414,7 +414,7 @@ VirtualMachineInner update(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -429,7 +429,7 @@ Mono>> deleteWithResponseAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -443,7 +443,7 @@ Mono>> deleteWithResponseAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -457,7 +457,7 @@ Mono>> deleteWithResponseAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
@@ -473,7 +473,7 @@ SyncPoller, Void> beginDelete(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -500,7 +500,7 @@ SyncPoller, Void> beginDelete(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -525,7 +525,7 @@ SyncPoller, Void> beginDelete(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointInner.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointInner.java
index b5852b7a1a01d..830365655f39f 100644
--- a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointInner.java
+++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointInner.java
@@ -9,10 +9,10 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.compute.models.ApiEntityReference;
import com.azure.resourcemanager.compute.models.ConsistencyModeTypes;
-import com.azure.resourcemanager.compute.models.RestorePointProvisioningDetails;
import com.azure.resourcemanager.compute.models.RestorePointSourceMetadata;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
import java.util.List;
/** Restore Point details. */
@@ -89,13 +89,26 @@ public ConsistencyModeTypes consistencyMode() {
}
/**
- * Get the provisioningDetails property: Gets the provisioning details set by the server during Create restore point
- * operation.
+ * Get the timeCreated property: Gets the creation time of the restore point.
*
- * @return the provisioningDetails value.
+ * @return the timeCreated value.
*/
- public RestorePointProvisioningDetails provisioningDetails() {
- return this.innerProperties() == null ? null : this.innerProperties().provisioningDetails();
+ public OffsetDateTime timeCreated() {
+ return this.innerProperties() == null ? null : this.innerProperties().timeCreated();
+ }
+
+ /**
+ * Set the timeCreated property: Gets the creation time of the restore point.
+ *
+ * @param timeCreated the timeCreated value to set.
+ * @return the RestorePointInner object itself.
+ */
+ public RestorePointInner withTimeCreated(OffsetDateTime timeCreated) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new RestorePointProperties();
+ }
+ this.innerProperties().withTimeCreated(timeCreated);
+ return this;
}
/**
diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointProperties.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointProperties.java
index b557007f5f90b..d1315f85fc1f0 100644
--- a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointProperties.java
+++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/RestorePointProperties.java
@@ -8,10 +8,10 @@
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.compute.models.ApiEntityReference;
import com.azure.resourcemanager.compute.models.ConsistencyModeTypes;
-import com.azure.resourcemanager.compute.models.RestorePointProvisioningDetails;
import com.azure.resourcemanager.compute.models.RestorePointSourceMetadata;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
import java.util.List;
/** The restore point properties. */
@@ -47,11 +47,10 @@ public final class RestorePointProperties {
private ConsistencyModeTypes consistencyMode;
/*
- * Gets the provisioning details set by the server during Create restore
- * point operation.
+ * Gets the creation time of the restore point.
*/
- @JsonProperty(value = "provisioningDetails", access = JsonProperty.Access.WRITE_ONLY)
- private RestorePointProvisioningDetails provisioningDetails;
+ @JsonProperty(value = "timeCreated")
+ private OffsetDateTime timeCreated;
/**
* Get the excludeDisks property: List of disk resource ids that the customer wishes to exclude from the restore
@@ -104,13 +103,23 @@ public ConsistencyModeTypes consistencyMode() {
}
/**
- * Get the provisioningDetails property: Gets the provisioning details set by the server during Create restore point
- * operation.
+ * Get the timeCreated property: Gets the creation time of the restore point.
*
- * @return the provisioningDetails value.
+ * @return the timeCreated value.
*/
- public RestorePointProvisioningDetails provisioningDetails() {
- return this.provisioningDetails;
+ public OffsetDateTime timeCreated() {
+ return this.timeCreated;
+ }
+
+ /**
+ * Set the timeCreated property: Gets the creation time of the restore point.
+ *
+ * @param timeCreated the timeCreated value to set.
+ * @return the RestorePointProperties object itself.
+ */
+ public RestorePointProperties withTimeCreated(OffsetDateTime timeCreated) {
+ this.timeCreated = timeCreated;
+ return this;
}
/**
@@ -125,8 +134,5 @@ public void validate() {
if (sourceMetadata() != null) {
sourceMetadata().validate();
}
- if (provisioningDetails() != null) {
- provisioningDetails().validate();
- }
}
}
diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java
index 1174e59aae433..72a8f0db3373b 100644
--- a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java
+++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java
@@ -1477,7 +1477,7 @@ public VirtualMachineInner update(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -1526,7 +1526,7 @@ public Mono>> deleteWithResponseAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -1573,7 +1573,7 @@ private Mono>> deleteWithResponseAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -1593,7 +1593,7 @@ public PollerFlux, Void> beginDeleteAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -1616,7 +1616,7 @@ private PollerFlux, Void> beginDeleteAsync(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -1633,7 +1633,7 @@ public SyncPoller, Void> beginDelete(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -1651,7 +1651,7 @@ public SyncPoller, Void> beginDelete(
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -1687,7 +1687,7 @@ public Mono deleteAsync(String resourceGroupName, String vmName) {
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -1706,7 +1706,7 @@ private Mono deleteAsync(String resourceGroupName, String vmName, Boolean
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -1736,7 +1736,7 @@ public void delete(String resourceGroupName, String vmName) {
*
* @param resourceGroupName The name of the resource group.
* @param vmName The name of the virtual machine.
- * @param forceDeletion Optional parameter to force delete virtual machines.(Feature in Preview).
+ * @param forceDeletion Optional parameter to force delete virtual machines.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java
index 3a548af587e06..3a57aa31c6455 100644
--- a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java
+++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/DiagnosticsProfile.java
@@ -16,17 +16,21 @@ public final class DiagnosticsProfile {
/*
* Boot Diagnostics is a debugging feature which allows you to view Console
- * Output and Screenshot to diagnose VM status.
You can easily
- * view the output of your console log.
Azure also enables you to
- * see a screenshot of the VM from the hypervisor.
+ * Output and Screenshot to diagnose VM status.
**NOTE**: If storageUri
+ * is being specified then ensure that the storage account is in the same
+ * region and subscription as the VM.
You can easily view the
+ * output of your console log.
Azure also enables you to see a
+ * screenshot of the VM from the hypervisor.
*/
@JsonProperty(value = "bootDiagnostics")
private BootDiagnostics bootDiagnostics;
/**
* Get the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output
- * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log.
- * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor.
+ * and Screenshot to diagnose VM status. <br>**NOTE**: If storageUri is being specified then ensure that the
+ * storage account is in the same region and subscription as the VM. <br><br> You can easily view the
+ * output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the
+ * hypervisor.
*
* @return the bootDiagnostics value.
*/
@@ -36,8 +40,10 @@ public BootDiagnostics bootDiagnostics() {
/**
* Set the bootDiagnostics property: Boot Diagnostics is a debugging feature which allows you to view Console Output
- * and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log.
- * <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor.
+ * and Screenshot to diagnose VM status. <br>**NOTE**: If storageUri is being specified then ensure that the
+ * storage account is in the same region and subscription as the VM. <br><br> You can easily view the
+ * output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the
+ * hypervisor.
*
* @param bootDiagnostics the bootDiagnostics value to set.
* @return the DiagnosticsProfile object itself.
diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RestorePointProvisioningDetails.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RestorePointProvisioningDetails.java
deleted file mode 100644
index 1429508c95fb0..0000000000000
--- a/sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/RestorePointProvisioningDetails.java
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.compute.models;
-
-import com.azure.core.annotation.Fluent;
-import com.azure.core.util.logging.ClientLogger;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.time.OffsetDateTime;
-
-/** Restore Point Provisioning details. */
-@Fluent
-public final class RestorePointProvisioningDetails {
- @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointProvisioningDetails.class);
-
- /*
- * Gets the creation time of the restore point.
- */
- @JsonProperty(value = "creationTime")
- private OffsetDateTime creationTime;
-
- /*
- * Gets the total size of the data in all the disks which are part of the
- * restore point.
- */
- @JsonProperty(value = "totalUsedSizeInBytes")
- private Long totalUsedSizeInBytes;
-
- /*
- * Gets the status of the Create restore point operation.
- */
- @JsonProperty(value = "statusCode")
- private Integer statusCode;
-
- /*
- * Gets the status message of the Create restore point operation.
- */
- @JsonProperty(value = "statusMessage")
- private String statusMessage;
-
- /**
- * Get the creationTime property: Gets the creation time of the restore point.
- *
- * @return the creationTime value.
- */
- public OffsetDateTime creationTime() {
- return this.creationTime;
- }
-
- /**
- * Set the creationTime property: Gets the creation time of the restore point.
- *
- * @param creationTime the creationTime value to set.
- * @return the RestorePointProvisioningDetails object itself.
- */
- public RestorePointProvisioningDetails withCreationTime(OffsetDateTime creationTime) {
- this.creationTime = creationTime;
- return this;
- }
-
- /**
- * Get the totalUsedSizeInBytes property: Gets the total size of the data in all the disks which are part of the
- * restore point.
- *
- * @return the totalUsedSizeInBytes value.
- */
- public Long totalUsedSizeInBytes() {
- return this.totalUsedSizeInBytes;
- }
-
- /**
- * Set the totalUsedSizeInBytes property: Gets the total size of the data in all the disks which are part of the
- * restore point.
- *
- * @param totalUsedSizeInBytes the totalUsedSizeInBytes value to set.
- * @return the RestorePointProvisioningDetails object itself.
- */
- public RestorePointProvisioningDetails withTotalUsedSizeInBytes(Long totalUsedSizeInBytes) {
- this.totalUsedSizeInBytes = totalUsedSizeInBytes;
- return this;
- }
-
- /**
- * Get the statusCode property: Gets the status of the Create restore point operation.
- *
- * @return the statusCode value.
- */
- public Integer statusCode() {
- return this.statusCode;
- }
-
- /**
- * Set the statusCode property: Gets the status of the Create restore point operation.
- *
- * @param statusCode the statusCode value to set.
- * @return the RestorePointProvisioningDetails object itself.
- */
- public RestorePointProvisioningDetails withStatusCode(Integer statusCode) {
- this.statusCode = statusCode;
- return this;
- }
-
- /**
- * Get the statusMessage property: Gets the status message of the Create restore point operation.
- *
- * @return the statusMessage value.
- */
- public String statusMessage() {
- return this.statusMessage;
- }
-
- /**
- * Set the statusMessage property: Gets the status message of the Create restore point operation.
- *
- * @param statusMessage the statusMessage value to set.
- * @return the RestorePointProvisioningDetails object itself.
- */
- public RestorePointProvisioningDetails withStatusMessage(String statusMessage) {
- this.statusMessage = statusMessage;
- return this;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- }
-}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/AvailabilitySetsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/AvailabilitySetsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..37dccfd5aba65
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/AvailabilitySetsCreateOrUpdateSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.AvailabilitySetInner;
+
+/** Samples for AvailabilitySets CreateOrUpdate. */
+public final class AvailabilitySetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnAvailabilitySet.json
+ */
+ /**
+ * Sample code: Create an availability set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAnAvailabilitySet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getAvailabilitySets()
+ .createOrUpdateWithResponse(
+ "myResourceGroup",
+ "myAvailabilitySet",
+ new AvailabilitySetInner()
+ .withLocation("westus")
+ .withPlatformUpdateDomainCount(20)
+ .withPlatformFaultDomainCount(2),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/AvailabilitySetsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/AvailabilitySetsListSamples.java
new file mode 100644
index 0000000000000..e21a6e63be29a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/AvailabilitySetsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailabilitySets List. */
+public final class AvailabilitySetsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListAvailabilitySetsInASubscription.json
+ */
+ /**
+ * Sample code: List availability sets in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAvailabilitySetsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getAvailabilitySets()
+ .list("virtualMachines\\$ref", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..e563e3f491c23
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsCreateOrUpdateSamples.java
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.CapacityReservationGroupInner;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CapacityReservationGroups CreateOrUpdate. */
+public final class CapacityReservationGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateACapacityReservationGroup.json
+ */
+ /**
+ * Sample code: Create or update a capacity reservation group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateACapacityReservationGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservationGroups()
+ .createOrUpdateWithResponse(
+ "myResourceGroup",
+ "myCapacityReservationGroup",
+ new CapacityReservationGroupInner()
+ .withLocation("westus")
+ .withTags(mapOf("department", "finance"))
+ .withZones(Arrays.asList("1", "2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..991ec1183c5a8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservationGroups GetByResourceGroup. */
+public final class CapacityReservationGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetACapacityReservationGroup.json
+ */
+ /**
+ * Sample code: Get a capacity reservation Group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getACapacityReservationGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservationGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myCapacityReservationGroup", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..7c85c18e17278
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsListByResourceGroupSamples.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.ExpandTypesForGetCapacityReservationGroups;
+
+/** Samples for CapacityReservationGroups ListByResourceGroup. */
+public final class CapacityReservationGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json
+ */
+ /**
+ * Sample code: List capacity reservation groups in resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCapacityReservationGroupsInResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservationGroups()
+ .listByResourceGroup(
+ "myResourceGroup", ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsListSamples.java
new file mode 100644
index 0000000000000..218029cd2136f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationGroupsListSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.ExpandTypesForGetCapacityReservationGroups;
+
+/** Samples for CapacityReservationGroups List. */
+public final class CapacityReservationGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListCapacityReservationGroupsInSubscription.json
+ */
+ /**
+ * Sample code: List capacity reservation groups in subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCapacityReservationGroupsInSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservationGroups()
+ .list(ExpandTypesForGetCapacityReservationGroups.VIRTUAL_MACHINES_REF, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..ec27bc1759c08
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsCreateOrUpdateSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.CapacityReservationInner;
+import com.azure.resourcemanager.compute.models.Sku;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CapacityReservations CreateOrUpdate. */
+public final class CapacityReservationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateACapacityReservation.json
+ */
+ /**
+ * Sample code: Create or update a capacity reservation .
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateACapacityReservation(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservations()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myCapacityReservationGroup",
+ "myCapacityReservation",
+ new CapacityReservationInner()
+ .withLocation("westus")
+ .withTags(mapOf("department", "HR"))
+ .withSku(new Sku().withName("Standard_DS1_v2").withCapacity(4L))
+ .withZones(Arrays.asList("1")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsGetSamples.java
new file mode 100644
index 0000000000000..a3e3b40482925
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservations Get. */
+public final class CapacityReservationsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetACapacityReservation.json
+ */
+ /**
+ * Sample code: Get a capacity reservation.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getACapacityReservation(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservations()
+ .getWithResponse(
+ "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsListByCapacityReservationGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsListByCapacityReservationGroupSamples.java
new file mode 100644
index 0000000000000..bda64be28354d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CapacityReservationsListByCapacityReservationGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CapacityReservations ListByCapacityReservationGroup. */
+public final class CapacityReservationsListByCapacityReservationGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListCapacityReservationsInReservationGroup.json
+ */
+ /**
+ * Sample code: List capacity reservations in reservation group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCapacityReservationsInReservationGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCapacityReservations()
+ .listByCapacityReservationGroup("myResourceGroup", "myCapacityReservationGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java
new file mode 100644
index 0000000000000..bdc148b9b948a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsGetOSFamilySamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems GetOSFamily. */
+public final class CloudServiceOperatingSystemsGetOSFamilySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json
+ */
+ /**
+ * Sample code: Get Cloud Service OS Family.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceOSFamily(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceOperatingSystems()
+ .getOSFamilyWithResponse("westus2", "3", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java
new file mode 100644
index 0000000000000..617c17575ea05
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsGetOSVersionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems GetOSVersion. */
+public final class CloudServiceOperatingSystemsGetOSVersionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json
+ */
+ /**
+ * Sample code: Get Cloud Service OS Version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceOSVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceOperatingSystems()
+ .getOSVersionWithResponse("westus2", "WA-GUEST-OS-3.90_202010-02", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java
new file mode 100644
index 0000000000000..b10c9670fa470
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsListOSFamiliesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems ListOSFamilies. */
+public final class CloudServiceOperatingSystemsListOSFamiliesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json
+ */
+ /**
+ * Sample code: List Cloud Service OS Families in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCloudServiceOSFamiliesInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceOperatingSystems()
+ .listOSFamilies("westus2", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java
new file mode 100644
index 0000000000000..4e67d26b63b62
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceOperatingSystemsListOSVersionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceOperatingSystems ListOSVersions. */
+public final class CloudServiceOperatingSystemsListOSVersionsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json
+ */
+ /**
+ * Sample code: List Cloud Service OS Versions in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCloudServiceOSVersionsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceOperatingSystems()
+ .listOSVersions("westus2", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesDeleteSamples.java
new file mode 100644
index 0000000000000..612db0650e0f1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Delete. */
+public final class CloudServiceRoleInstancesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Delete Cloud Service Role Instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteCloudServiceRoleInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .delete("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesGetInstanceViewSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesGetInstanceViewSamples.java
new file mode 100644
index 0000000000000..af28922196f8b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesGetInstanceViewSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances GetInstanceView. */
+public final class CloudServiceRoleInstancesGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Get Instance View of Cloud Service Role Instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInstanceViewOfCloudServiceRoleInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .getInstanceViewWithResponse("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesGetSamples.java
new file mode 100644
index 0000000000000..72c4877e1d7ab
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Get. */
+public final class CloudServiceRoleInstancesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Get Cloud Service Role Instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceRoleInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .getWithResponse("{roleInstance-name}", "ConstosoRG", "{cs-name}", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesListSamples.java
new file mode 100644
index 0000000000000..97b483f3d57f8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances List. */
+public final class CloudServiceRoleInstancesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json
+ */
+ /**
+ * Sample code: List Role Instances in a Cloud Service.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listRoleInstancesInACloudService(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .list("ConstosoRG", "{cs-name}", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesRebuildSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesRebuildSamples.java
new file mode 100644
index 0000000000000..dffc6f7609f07
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesRebuildSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Rebuild. */
+public final class CloudServiceRoleInstancesRebuildSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Rebuild Cloud Service Role Instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void rebuildCloudServiceRoleInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .rebuild("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesReimageSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesReimageSamples.java
new file mode 100644
index 0000000000000..7268860c06f1e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesReimageSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Reimage. */
+public final class CloudServiceRoleInstancesReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Reimage Cloud Service Role Instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void reimageCloudServiceRoleInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .reimage("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesRestartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesRestartSamples.java
new file mode 100644
index 0000000000000..08f2ae8e0023e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRoleInstancesRestartSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoleInstances Restart. */
+public final class CloudServiceRoleInstancesRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json
+ */
+ /**
+ * Sample code: Restart Cloud Service Role Instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void restartCloudServiceRoleInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoleInstances()
+ .restart("{roleInstance-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRolesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRolesGetSamples.java
new file mode 100644
index 0000000000000..b9ba6d8c4f548
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRolesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoles Get. */
+public final class CloudServiceRolesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json
+ */
+ /**
+ * Sample code: Get Cloud Service Role.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceRole(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoles()
+ .getWithResponse("{role-name}", "ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRolesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRolesListSamples.java
new file mode 100644
index 0000000000000..185b5339e4ca3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServiceRolesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServiceRoles List. */
+public final class CloudServiceRolesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json
+ */
+ /**
+ * Sample code: List Roles in a Cloud Service.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listRolesInACloudService(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServiceRoles()
+ .list("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..e47c601299fe7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesCreateOrUpdateSamples.java
@@ -0,0 +1,308 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.CloudServiceInner;
+import com.azure.resourcemanager.compute.models.CloudServiceExtensionProfile;
+import com.azure.resourcemanager.compute.models.CloudServiceExtensionProperties;
+import com.azure.resourcemanager.compute.models.CloudServiceNetworkProfile;
+import com.azure.resourcemanager.compute.models.CloudServiceOsProfile;
+import com.azure.resourcemanager.compute.models.CloudServiceProperties;
+import com.azure.resourcemanager.compute.models.CloudServiceRoleProfile;
+import com.azure.resourcemanager.compute.models.CloudServiceRoleProfileProperties;
+import com.azure.resourcemanager.compute.models.CloudServiceRoleSku;
+import com.azure.resourcemanager.compute.models.CloudServiceUpgradeMode;
+import com.azure.resourcemanager.compute.models.CloudServiceVaultCertificate;
+import com.azure.resourcemanager.compute.models.CloudServiceVaultSecretGroup;
+import com.azure.resourcemanager.compute.models.Extension;
+import com.azure.resourcemanager.compute.models.LoadBalancerConfiguration;
+import com.azure.resourcemanager.compute.models.LoadBalancerConfigurationProperties;
+import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfiguration;
+import com.azure.resourcemanager.compute.models.LoadBalancerFrontendIpConfigurationProperties;
+import java.util.Arrays;
+
+/** Samples for CloudServices CreateOrUpdate. */
+public final class CloudServicesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRole.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Single Role.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createNewCloudServiceWithSingleRole(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .createOrUpdate(
+ "ConstosoRG",
+ "{cs-name}",
+ new CloudServiceInner()
+ .withLocation("westus")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("myLoadBalancer")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("myfe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")))))))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndCertificate.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Single Role and Certificate from Key Vault.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .createOrUpdate(
+ "ConstosoRG",
+ "{cs-name}",
+ new CloudServiceInner()
+ .withLocation("westus")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withOsProfile(
+ new CloudServiceOsProfile()
+ .withSecrets(
+ Arrays
+ .asList(
+ new CloudServiceVaultSecretGroup()
+ .withSourceVault(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"))
+ .withVaultCertificates(
+ Arrays
+ .asList(
+ new CloudServiceVaultCertificate()
+ .withCertificateUrl(
+ "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"))))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("contosolb")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("contosofe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithSingleRoleAndRDP.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Single Role and RDP Extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createNewCloudServiceWithSingleRoleAndRDPExtension(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .createOrUpdate(
+ "ConstosoRG",
+ "{cs-name}",
+ new CloudServiceInner()
+ .withLocation("westus")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("contosolb")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("contosofe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))
+ .withExtensionProfile(
+ new CloudServiceExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new Extension()
+ .withName("RDPExtension")
+ .withProperties(
+ new CloudServiceExtensionProperties()
+ .withPublisher("Microsoft.Windows.Azure.Extensions")
+ .withType("RDP")
+ .withTypeHandlerVersion("1.2.1")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ "UserAzure10/22/2021"
+ + " 15:05:45")
+ .withProtectedSettings(
+ "{password}")))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json
+ */
+ /**
+ * Sample code: Create New Cloud Service with Multiple Roles.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createNewCloudServiceWithMultipleRoles(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .createOrUpdate(
+ "ConstosoRG",
+ "{cs-name}",
+ new CloudServiceInner()
+ .withLocation("westus")
+ .withProperties(
+ new CloudServiceProperties()
+ .withPackageUrl("{PackageUrl}")
+ .withConfiguration("{ServiceConfiguration}")
+ .withUpgradeMode(CloudServiceUpgradeMode.AUTO)
+ .withRoleProfile(
+ new CloudServiceRoleProfile()
+ .withRoles(
+ Arrays
+ .asList(
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoFrontend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)),
+ new CloudServiceRoleProfileProperties()
+ .withName("ContosoBackend")
+ .withSku(
+ new CloudServiceRoleSku()
+ .withName("Standard_D1_v2")
+ .withTier("Standard")
+ .withCapacity(1L)))))
+ .withNetworkProfile(
+ new CloudServiceNetworkProfile()
+ .withLoadBalancerConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerConfiguration()
+ .withName("contosolb")
+ .withProperties(
+ new LoadBalancerConfigurationProperties()
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new LoadBalancerFrontendIpConfiguration()
+ .withName("contosofe")
+ .withProperties(
+ new LoadBalancerFrontendIpConfigurationProperties()
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))))))))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesDeleteInstancesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesDeleteInstancesSamples.java
new file mode 100644
index 0000000000000..bf07080137690
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesDeleteInstancesSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices DeleteInstances. */
+public final class CloudServicesDeleteInstancesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Delete Cloud Service Role Instances.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteCloudServiceRoleInstances(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .deleteInstances(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesDeleteSamples.java
new file mode 100644
index 0000000000000..573dff49ef681
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices Delete. */
+public final class CloudServicesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json
+ */
+ /**
+ * Sample code: Delete Cloud Service.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteCloudService(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .delete("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..07d5a1bfcc52d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesGetByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices GetByResourceGroup. */
+public final class CloudServicesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json
+ */
+ /**
+ * Sample code: Get Cloud Service with Multiple Roles and RDP Extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceWithMultipleRolesAndRDPExtension(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .getByResourceGroupWithResponse("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesGetInstanceViewSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesGetInstanceViewSamples.java
new file mode 100644
index 0000000000000..193b906ef1c64
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesGetInstanceViewSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices GetInstanceView. */
+public final class CloudServicesGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json
+ */
+ /**
+ * Sample code: Get Cloud Service Instance View with Multiple Roles.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceInstanceViewWithMultipleRoles(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .getInstanceViewWithResponse("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..298ddd95341e9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices ListByResourceGroup. */
+public final class CloudServicesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json
+ */
+ /**
+ * Sample code: List Cloud Services in a Resource Group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCloudServicesInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .listByResourceGroup("ConstosoRG", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesListSamples.java
new file mode 100644
index 0000000000000..9764b49c372b5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices List. */
+public final class CloudServicesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json
+ */
+ /**
+ * Sample code: List Cloud Services in a Subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listCloudServicesInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getCloudServices().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesPowerOffSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesPowerOffSamples.java
new file mode 100644
index 0000000000000..ebcbbe53200ab
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesPowerOffSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices PowerOff. */
+public final class CloudServicesPowerOffSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json
+ */
+ /**
+ * Sample code: Stop or PowerOff Cloud Service.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void stopOrPowerOffCloudService(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .powerOff("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesRebuildSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesRebuildSamples.java
new file mode 100644
index 0000000000000..da127fd5e4246
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesRebuildSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices Rebuild. */
+public final class CloudServicesRebuildSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Rebuild Cloud Service Role Instances.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void rebuildCloudServiceRoleInstances(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .rebuild(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesReimageSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesReimageSamples.java
new file mode 100644
index 0000000000000..799c066e469ae
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesReimageSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices Reimage. */
+public final class CloudServicesReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Reimage Cloud Service Role Instances.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void reimageCloudServiceRoleInstances(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .reimage(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesRestartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesRestartSamples.java
new file mode 100644
index 0000000000000..f218698348693
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesRestartSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.RoleInstances;
+import java.util.Arrays;
+
+/** Samples for CloudServices Restart. */
+public final class CloudServicesRestartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json
+ */
+ /**
+ * Sample code: Restart Cloud Service Role Instances.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void restartCloudServiceRoleInstances(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .restart(
+ "ConstosoRG",
+ "{cs-name}",
+ new RoleInstances().withRoleInstances(Arrays.asList("ContosoFrontend_IN_0", "ContosoBackend_IN_1")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesStartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesStartSamples.java
new file mode 100644
index 0000000000000..1ea137384b9bc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesStartSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServices Start. */
+public final class CloudServicesStartSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json
+ */
+ /**
+ * Sample code: Start Cloud Service.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void startCloudService(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .start("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java
new file mode 100644
index 0000000000000..c89c69029117a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainGetUpdateDomainSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServicesUpdateDomain GetUpdateDomain. */
+public final class CloudServicesUpdateDomainGetUpdateDomainSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json
+ */
+ /**
+ * Sample code: Get Cloud Service Update Domain.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCloudServiceUpdateDomain(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServicesUpdateDomains()
+ .getUpdateDomainWithResponse("ConstosoRG", "{cs-name}", 1, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java
new file mode 100644
index 0000000000000..d0a6ece3df568
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainListUpdateDomainsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServicesUpdateDomain ListUpdateDomains. */
+public final class CloudServicesUpdateDomainListUpdateDomainsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json
+ */
+ /**
+ * Sample code: List Update Domains in Cloud Service.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listUpdateDomainsInCloudService(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServicesUpdateDomains()
+ .listUpdateDomains("ConstosoRG", "{cs-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java
new file mode 100644
index 0000000000000..2ebaff1cf434b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateDomainWalkUpdateDomainSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CloudServicesUpdateDomain WalkUpdateDomain. */
+public final class CloudServicesUpdateDomainWalkUpdateDomainSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json
+ */
+ /**
+ * Sample code: Update Cloud Service to specified Domain.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateCloudServiceToSpecifiedDomain(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServicesUpdateDomains()
+ .walkUpdateDomain("ConstosoRG", "{cs-name}", 1, null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateSamples.java
new file mode 100644
index 0000000000000..8978600a9992f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CloudServicesUpdateSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.CloudServiceUpdate;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CloudServices Update. */
+public final class CloudServicesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json
+ */
+ /**
+ * Sample code: Update existing Cloud Service to add tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateExistingCloudServiceToAddTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCloudServices()
+ .update(
+ "ConstosoRG",
+ "{cs-name}",
+ new CloudServiceUpdate().withTags(mapOf("Documentation", "RestAPI")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java
new file mode 100644
index 0000000000000..22e31209c71c0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleriesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CommunityGalleries Get. */
+public final class CommunityGalleriesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCommunityGalleries()
+ .getWithResponse("myLocation", "publicGalleryName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java
new file mode 100644
index 0000000000000..d9f5183093cdd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImageVersionsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CommunityGalleryImageVersions Get. */
+public final class CommunityGalleryImageVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCommunityGalleryImageVersions()
+ .getWithResponse(
+ "myLocation", "publicGalleryName", "myGalleryImageName", "myGalleryImageVersionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java
new file mode 100644
index 0000000000000..10da1fa920028
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/CommunityGalleryImagesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CommunityGalleryImages Get. */
+public final class CommunityGalleryImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getCommunityGalleryImages()
+ .getWithResponse("myLocation", "publicGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostGroupsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostGroupsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..fe428d942ed89
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostGroupsCreateOrUpdateSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.DedicatedHostGroupInner;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DedicatedHostGroups CreateOrUpdate. */
+public final class DedicatedHostGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateADedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Create or update a dedicated host group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateADedicatedHostGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDedicatedHostGroups()
+ .createOrUpdateWithResponse(
+ "myResourceGroup",
+ "myDedicatedHostGroup",
+ new DedicatedHostGroupInner()
+ .withLocation("westus")
+ .withTags(mapOf("department", "finance"))
+ .withZones(Arrays.asList("1"))
+ .withPlatformFaultDomainCount(3)
+ .withSupportAutomaticPlacement(true),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostGroupsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostGroupsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..65825dc017757
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostGroupsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHostGroups GetByResourceGroup. */
+public final class DedicatedHostGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetADedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Create a dedicated host group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createADedicatedHostGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDedicatedHostGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDedicatedHostGroup", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..621d38538828c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostsCreateOrUpdateSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.DedicatedHostInner;
+import com.azure.resourcemanager.compute.models.Sku;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DedicatedHosts CreateOrUpdate. */
+public final class DedicatedHostsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateADedicatedHost.json
+ */
+ /**
+ * Sample code: Create or update a dedicated host .
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateADedicatedHost(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDedicatedHosts()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDedicatedHostGroup",
+ "myDedicatedHost",
+ new DedicatedHostInner()
+ .withLocation("westus")
+ .withTags(mapOf("department", "HR"))
+ .withSku(new Sku().withName("DSv3-Type1"))
+ .withPlatformFaultDomain(1),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostsGetSamples.java
new file mode 100644
index 0000000000000..a6d04f595bd9f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DedicatedHostsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DedicatedHosts Get. */
+public final class DedicatedHostsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetADedicatedHost.json
+ */
+ /**
+ * Sample code: Get a dedicated host.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getADedicatedHost(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDedicatedHosts()
+ .getWithResponse("myResourceGroup", "myDedicatedHostGroup", "myHost", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5007c9405f6ab
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesCreateOrUpdateSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.DiskAccessInner;
+
+/** Samples for DiskAccesses CreateOrUpdate. */
+public final class DiskAccessesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateADiskAccess.json
+ */
+ /**
+ * Sample code: Create a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createADiskAccessResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .createOrUpdate(
+ "myResourceGroup", "myDiskAccess", new DiskAccessInner().withLocation("West US"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.java
new file mode 100644
index 0000000000000..4011cba53bd93
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesDeleteAPrivateEndpointConnectionSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses DeleteAPrivateEndpointConnection. */
+public final class DiskAccessesDeleteAPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/DeleteAPrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Delete a private endpoint connection under a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .deleteAPrivateEndpointConnection(
+ "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesDeleteSamples.java
new file mode 100644
index 0000000000000..f8253efae8589
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses Delete. */
+public final class DiskAccessesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/DeleteADiskAccess.json
+ */
+ /**
+ * Sample code: Delete a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteADiskAccessResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .delete("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.java
new file mode 100644
index 0000000000000..b2c0e35667410
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetAPrivateEndpointConnectionSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses GetAPrivateEndpointConnection. */
+public final class DiskAccessesGetAPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutAPrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Get information about a private endpoint connection under a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .getAPrivateEndpointConnectionWithResponse(
+ "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..3689e7893bb29
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetByResourceGroupSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses GetByResourceGroup. */
+public final class DiskAccessesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutADiskAccess.json
+ */
+ /**
+ * Sample code: Get information about a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutADiskAccessResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json
+ */
+ /**
+ * Sample code: Get information about a disk access resource with private endpoints.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutADiskAccessResourceWithPrivateEndpoints(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetPrivateLinkResourcesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetPrivateLinkResourcesSamples.java
new file mode 100644
index 0000000000000..7dd1da126a033
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesGetPrivateLinkResourcesSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses GetPrivateLinkResources. */
+public final class DiskAccessesGetPrivateLinkResourcesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetDiskAccessPrivateLinkResources.json
+ */
+ /**
+ * Sample code: List all possible private link resources under disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllPossiblePrivateLinkResourcesUnderDiskAccessResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .getPrivateLinkResourcesWithResponse("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..a653c321b875e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses ListByResourceGroup. */
+public final class DiskAccessesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListDiskAccessesInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all disk access resources in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllDiskAccessResourcesInAResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java
new file mode 100644
index 0000000000000..9fc68a85d1630
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListPrivateEndpointConnectionsSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses ListPrivateEndpointConnections. */
+public final class DiskAccessesListPrivateEndpointConnectionsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json
+ */
+ /**
+ * Sample code: Get information about a private endpoint connection under a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .listPrivateEndpointConnections("myResourceGroup", "myDiskAccess", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListSamples.java
new file mode 100644
index 0000000000000..90a4ef6338fc5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskAccesses List. */
+public final class DiskAccessesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListDiskAccessesInASubscription.json
+ */
+ /**
+ * Sample code: List all disk access resources in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllDiskAccessResourcesInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getDiskAccesses().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.java
new file mode 100644
index 0000000000000..eb8e0efc7a485
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesUpdateAPrivateEndpointConnectionSamples.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.compute.models.PrivateEndpointServiceConnectionStatus;
+import com.azure.resourcemanager.compute.models.PrivateLinkServiceConnectionState;
+
+/** Samples for DiskAccesses UpdateAPrivateEndpointConnection. */
+public final class DiskAccessesUpdateAPrivateEndpointConnectionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ApprovePrivateEndpointConnection.json
+ */
+ /**
+ * Sample code: Approve a Private Endpoint Connection under a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void approveAPrivateEndpointConnectionUnderADiskAccessResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .updateAPrivateEndpointConnection(
+ "myResourceGroup",
+ "myDiskAccess",
+ "myPrivateEndpointConnection",
+ new PrivateEndpointConnectionInner()
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState()
+ .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED)
+ .withDescription("Approving myPrivateEndpointConnection")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesUpdateSamples.java
new file mode 100644
index 0000000000000..769b983e5e0db
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskAccessesUpdateSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.DiskAccessUpdate;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DiskAccesses Update. */
+public final class DiskAccessesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateADiskAccess.json
+ */
+ /**
+ * Sample code: Update a disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateADiskAccessResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskAccesses()
+ .update(
+ "myResourceGroup",
+ "myDiskAccess",
+ new DiskAccessUpdate().withTags(mapOf("department", "Development", "project", "PrivateEndpoints")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..ad98164cc0813
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsCreateOrUpdateSamples.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.DiskEncryptionSetInner;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetIdentityType;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetType;
+import com.azure.resourcemanager.compute.models.EncryptionSetIdentity;
+import com.azure.resourcemanager.compute.models.KeyForDiskEncryptionSet;
+import com.azure.resourcemanager.compute.models.SourceVault;
+
+/** Samples for DiskEncryptionSets CreateOrUpdate. */
+public final class DiskEncryptionSetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a disk encryption set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createADiskEncryptionSet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDiskEncryptionSet",
+ new DiskEncryptionSetInner()
+ .withLocation("West US")
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withSourceVault(
+ new SourceVault()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"))
+ .withKeyUrl("https://myvmvault.vault-int.azure-int.net/keys/{key}")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json
+ */
+ /**
+ * Sample code: Create a disk encryption set with key vault from a different subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createADiskEncryptionSetWithKeyVaultFromADifferentSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDiskEncryptionSet",
+ new DiskEncryptionSetInner()
+ .withLocation("West US")
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withKeyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsDeleteSamples.java
new file mode 100644
index 0000000000000..173d2272a0e06
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets Delete. */
+public final class DiskEncryptionSetsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/DeleteADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Delete a disk encryption set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteADiskEncryptionSet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .delete("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..2adfcb719ec00
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsGetByResourceGroupSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets GetByResourceGroup. */
+public final class DiskEncryptionSetsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Get information about a disk encryption set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutADiskEncryptionSet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json
+ */
+ /**
+ * Sample code: Get information about a disk encryption set when auto-key rotation failed.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java
new file mode 100644
index 0000000000000..f12a79b8bd51b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListAssociatedResourcesSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets ListAssociatedResources. */
+public final class DiskEncryptionSetsListAssociatedResourcesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListDiskEncryptionSetAssociatedResources.json
+ */
+ /**
+ * Sample code: List all resources that are encrypted with this disk encryption set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllResourcesThatAreEncryptedWithThisDiskEncryptionSet(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .listAssociatedResources("myResourceGroup", "myDiskEncryptionSet", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..701aad2bb143f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets ListByResourceGroup. */
+public final class DiskEncryptionSetsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListDiskEncryptionSetsInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all disk encryption sets in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllDiskEncryptionSetsInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListSamples.java
new file mode 100644
index 0000000000000..411ea3b231ad7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskEncryptionSets List. */
+public final class DiskEncryptionSetsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListDiskEncryptionSetsInASubscription.json
+ */
+ /**
+ * Sample code: List all disk encryption sets in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllDiskEncryptionSetsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getDiskEncryptionSets().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsUpdateSamples.java
new file mode 100644
index 0000000000000..4bffbb91fa7b2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskEncryptionSetsUpdateSamples.java
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetIdentityType;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetType;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetUpdate;
+import com.azure.resourcemanager.compute.models.EncryptionSetIdentity;
+import com.azure.resourcemanager.compute.models.KeyForDiskEncryptionSet;
+import com.azure.resourcemanager.compute.models.SourceVault;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DiskEncryptionSets Update. */
+public final class DiskEncryptionSetsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json
+ */
+ /**
+ * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Succeeded.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .update(
+ "myResourceGroup",
+ "myDiskEncryptionSet",
+ new DiskEncryptionSetUpdate()
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withKeyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"))
+ .withRotationToLatestKeyVersionEnabled(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledInProgress.json
+ */
+ /**
+ * Sample code: Update a disk encryption set with rotationToLatestKeyVersionEnabled set to true - Updating.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .update(
+ "myResourceGroup",
+ "myDiskEncryptionSet",
+ new DiskEncryptionSetUpdate()
+ .withIdentity(new EncryptionSetIdentity().withType(DiskEncryptionSetIdentityType.SYSTEM_ASSIGNED))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withKeyUrl("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"))
+ .withRotationToLatestKeyVersionEnabled(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateADiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Update a disk encryption set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateADiskEncryptionSet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskEncryptionSets()
+ .update(
+ "myResourceGroup",
+ "myDiskEncryptionSet",
+ new DiskEncryptionSetUpdate()
+ .withTags(mapOf("department", "Development", "project", "Encryption"))
+ .withEncryptionType(DiskEncryptionSetType.ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY)
+ .withActiveKey(
+ new KeyForDiskEncryptionSet()
+ .withSourceVault(
+ new SourceVault()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"))
+ .withKeyUrl("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointGetSamples.java
new file mode 100644
index 0000000000000..baeabc66afe30
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointGetSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskRestorePoint Get. */
+public final class DiskRestorePointGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetDiskRestorePointResources.json
+ */
+ /**
+ * Sample code: Get an incremental disk restorePoint resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAnIncrementalDiskRestorePointResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskRestorePoints()
+ .getWithResponse(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointGrantAccessSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointGrantAccessSamples.java
new file mode 100644
index 0000000000000..6f5b3f749c42e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointGrantAccessSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.AccessLevel;
+import com.azure.resourcemanager.compute.models.GrantAccessData;
+
+/** Samples for DiskRestorePoint GrantAccess. */
+public final class DiskRestorePointGrantAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/BeginGetAccessDiskRestorePoint.json
+ */
+ /**
+ * Sample code: Grants access to a diskRestorePoint.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void grantsAccessToADiskRestorePoint(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskRestorePoints()
+ .grantAccess(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointListByRestorePointSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointListByRestorePointSamples.java
new file mode 100644
index 0000000000000..4276d9c75f6d2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointListByRestorePointSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskRestorePoint ListByRestorePoint. */
+public final class DiskRestorePointListByRestorePointSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListDiskRestorePointsInVmRestorePoint.json
+ */
+ /**
+ * Sample code: Get an incremental disk restorePoint resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAnIncrementalDiskRestorePointResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskRestorePoints()
+ .listByRestorePoint("myResourceGroup", "rpc", "vmrp", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointRevokeAccessSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointRevokeAccessSamples.java
new file mode 100644
index 0000000000000..036f9ae659007
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DiskRestorePointRevokeAccessSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DiskRestorePoint RevokeAccess. */
+public final class DiskRestorePointRevokeAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/EndGetAccessDiskRestorePoint.json
+ */
+ /**
+ * Sample code: Revokes access to a diskRestorePoint.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void revokesAccessToADiskRestorePoint(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDiskRestorePoints()
+ .revokeAccess(
+ "myResourceGroup",
+ "rpc",
+ "vmrp",
+ "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..e6fcc2ec012ff
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksCreateOrUpdateSamples.java
@@ -0,0 +1,379 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.DiskInner;
+import com.azure.resourcemanager.compute.models.CreationData;
+import com.azure.resourcemanager.compute.models.DiskCreateOption;
+import com.azure.resourcemanager.compute.models.DiskSecurityProfile;
+import com.azure.resourcemanager.compute.models.DiskSecurityTypes;
+import com.azure.resourcemanager.compute.models.DiskSku;
+import com.azure.resourcemanager.compute.models.DiskStorageAccountTypes;
+import com.azure.resourcemanager.compute.models.Encryption;
+import com.azure.resourcemanager.compute.models.ExtendedLocation;
+import com.azure.resourcemanager.compute.models.ExtendedLocationTypes;
+import com.azure.resourcemanager.compute.models.ImageDiskReference;
+import com.azure.resourcemanager.compute.models.NetworkAccessPolicy;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+
+/** Samples for Disks CreateOrUpdate. */
+public final class DisksCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription.json
+ */
+ /**
+ * Sample code: Create a managed disk by importing an unmanaged blob from a different subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withStorageAccountId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskWithDiskAccess.json
+ */
+ /**
+ * Sample code: Create a managed disk and associate with disk access resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskAndAssociateWithDiskAccessResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_PRIVATE)
+ .withDiskAccessId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a managed disk and associate with disk encryption set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskAndAssociateWithDiskEncryptionSet(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200)
+ .withEncryption(
+ new Encryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskFromAnExistingManagedDisk.json
+ */
+ /**
+ * Sample code: Create a managed disk from an existing managed disk in the same or different subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk2",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY)
+ .withSourceResourceId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskWithSecurityProfile.json
+ */
+ /**
+ * Sample code: Create a managed disk with security profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskWithSecurityProfile(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("North Central US")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.FROM_IMAGE)
+ .withImageReference(
+ new ImageDiskReference()
+ .withId(
+ "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}")))
+ .withSecurityProfile(new DiskSecurityProfile().withSecurityType(DiskSecurityTypes.TRUSTED_LAUNCH)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskWithLogicalSectorSize.json
+ */
+ /**
+ * Sample code: Create an ultra managed disk with logicalSectorSize 512E.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAnUltraManagedDiskWithLogicalSectorSize512E(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withSku(new DiskSku().withName(DiskStorageAccountTypes.ULTRA_SSD_LRS))
+ .withCreationData(
+ new CreationData().withCreateOption(DiskCreateOption.EMPTY).withLogicalSectorSize(512))
+ .withDiskSizeGB(200),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskFromAPlatformImage.json
+ */
+ /**
+ * Sample code: Create a managed disk from a platform image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskFromAPlatformImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.FROM_IMAGE)
+ .withImageReference(
+ new ImageDiskReference()
+ .withId(
+ "/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAnEmptyManagedDisk.json
+ */
+ /**
+ * Sample code: Create an empty managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAnEmptyManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription.json
+ */
+ /**
+ * Sample code: Create a managed disk by importing an unmanaged blob from the same subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskByCopyingASnapshot.json
+ */
+ /**
+ * Sample code: Create a managed disk by copying a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskByCopyingASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY)
+ .withSourceResourceId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedDiskWithSSDZRSAccountType.json
+ */
+ /**
+ * Sample code: Create a managed disk with ssd zrs account type.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedDiskWithSsdZrsAccountType(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withSku(new DiskSku().withName(DiskStorageAccountTypes.PREMIUM_ZRS))
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAnEmptyManagedDiskInExtendedLocation.json
+ */
+ /**
+ * Sample code: Create an empty managed disk in extended location.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAnEmptyManagedDiskInExtendedLocation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withExtendedLocation(
+ new ExtendedLocation().withName("{edge-zone-id}").withType(ExtendedLocationTypes.EDGE_ZONE))
+ .withCreationData(new CreationData().withCreateOption(DiskCreateOption.EMPTY))
+ .withDiskSizeGB(200),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateAManagedUploadDisk.json
+ */
+ /**
+ * Sample code: Create a managed upload disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAManagedUploadDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myDisk",
+ new DiskInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData().withCreateOption(DiskCreateOption.UPLOAD).withUploadSizeBytes(10737418752L)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksDeleteSamples.java
new file mode 100644
index 0000000000000..a596219ea0865
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Disks Delete. */
+public final class DisksDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/DeleteAManagedDisk.json
+ */
+ /**
+ * Sample code: Delete a managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getDisks().delete("myResourceGroup", "myDisk", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..ce3f8bb25e04f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Disks GetByResourceGroup. */
+public final class DisksGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutAManagedDisk.json
+ */
+ /**
+ * Sample code: Get information about a managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutAManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .getByResourceGroupWithResponse("myResourceGroup", "myManagedDisk", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksGrantAccessSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksGrantAccessSamples.java
new file mode 100644
index 0000000000000..a9b6908ce45a9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksGrantAccessSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.AccessLevel;
+import com.azure.resourcemanager.compute.models.GrantAccessData;
+
+/** Samples for Disks GrantAccess. */
+public final class DisksGrantAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/BeginGetAccessManagedDisk.json
+ */
+ /**
+ * Sample code: Get a sas on a managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getASasOnAManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .grantAccess(
+ "myResourceGroup",
+ "myDisk",
+ new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..f8e94063c7ddd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Disks ListByResourceGroup. */
+public final class DisksListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListManagedDisksInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all managed disks in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllManagedDisksInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksListSamples.java
new file mode 100644
index 0000000000000..81d16c49d2a8c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Disks List. */
+public final class DisksListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListManagedDisksInASubscription.json
+ */
+ /**
+ * Sample code: List all managed disks in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllManagedDisksInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getDisks().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksRevokeAccessSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksRevokeAccessSamples.java
new file mode 100644
index 0000000000000..d7f728d48ea26
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksRevokeAccessSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Disks RevokeAccess. */
+public final class DisksRevokeAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/EndGetAccessManagedDisk.json
+ */
+ /**
+ * Sample code: Revoke access to a managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void revokeAccessToAManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .revokeAccess("myResourceGroup", "myDisk", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksUpdateSamples.java
new file mode 100644
index 0000000000000..ec3711b0e681c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/DisksUpdateSamples.java
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.DiskUpdate;
+import com.azure.resourcemanager.compute.models.NetworkAccessPolicy;
+import com.azure.resourcemanager.compute.models.PurchasePlanAutoGenerated;
+import com.azure.resourcemanager.compute.models.SupportedCapabilities;
+
+/** Samples for Disks Update. */
+public final class DisksUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateAManagedDiskToDisableBursting.json
+ */
+ /**
+ * Sample code: Update a managed disk to disable bursting.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAManagedDiskToDisableBursting(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update("myResourceGroup", "myDisk", new DiskUpdate().withBurstingEnabled(false), Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateAManagedDiskToAddPurchasePlan.json
+ */
+ /**
+ * Sample code: Update a managed disk to add purchase plan.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAManagedDiskToAddPurchasePlan(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update(
+ "myResourceGroup",
+ "myDisk",
+ new DiskUpdate()
+ .withPurchasePlan(
+ new PurchasePlanAutoGenerated()
+ .withName("myPurchasePlanName")
+ .withPublisher("myPurchasePlanPublisher")
+ .withProduct("myPurchasePlanProduct")
+ .withPromotionCode("myPurchasePlanPromotionCode")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateAManagedDiskToChangeTier.json
+ */
+ /**
+ * Sample code: Update a managed disk to change tier.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAManagedDiskToChangeTier(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update("myResourceGroup", "myDisk", new DiskUpdate().withTier("P30"), Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json
+ */
+ /**
+ * Sample code: Create or update a bursting enabled managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateABurstingEnabledManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update(
+ "myResourceGroup",
+ "myDisk",
+ new DiskUpdate().withDiskSizeGB(1024).withBurstingEnabled(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateAManagedDiskToAddSupportsHibernation.json
+ */
+ /**
+ * Sample code: Update a managed disk to add supportsHibernation.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAManagedDiskToAddSupportsHibernation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update("myResourceGroup", "myDisk", new DiskUpdate().withSupportsHibernation(true), Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateAManagedDiskToRemoveDiskAccess.json
+ */
+ /**
+ * Sample code: Update managed disk to remove disk access resource association.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateManagedDiskToRemoveDiskAccessResourceAssociation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update(
+ "myResourceGroup",
+ "myDisk",
+ new DiskUpdate().withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_ALL),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateAManagedDiskToAddAcceleratedNetworking.json
+ */
+ /**
+ * Sample code: Update a managed disk to add accelerated networking.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAManagedDiskToAddAcceleratedNetworking(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getDisks()
+ .update(
+ "myResourceGroup",
+ "myDisk",
+ new DiskUpdate().withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..3e9eed3426832
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesCreateOrUpdateSamples.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.GalleryInner;
+import com.azure.resourcemanager.compute.models.GallerySharingPermissionTypes;
+import com.azure.resourcemanager.compute.models.SharingProfile;
+import com.azure.resourcemanager.compute.models.SoftDeletePolicy;
+
+/** Samples for Galleries CreateOrUpdate. */
+public final class GalleriesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSharingProfile.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery with sharing profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryWithSharingProfile(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ new GalleryInner()
+ .withLocation("West US")
+ .withDescription("This is the gallery description.")
+ .withSharingProfile(new SharingProfile().withPermissions(GallerySharingPermissionTypes.GROUPS)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGallery.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ new GalleryInner().withLocation("West US").withDescription("This is the gallery description."),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryWithSoftDeletionEnabled.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery with soft deletion enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryWithSoftDeletionEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ new GalleryInner()
+ .withLocation("West US")
+ .withDescription("This is the gallery description.")
+ .withSoftDeletePolicy(new SoftDeletePolicy().withIsSoftDeleteEnabled(true)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java
new file mode 100644
index 0000000000000..93bcd3cc1b09f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Galleries Delete. */
+public final class GalleriesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGallery.json
+ */
+ /**
+ * Sample code: Delete a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .delete("myResourceGroup", "myGalleryName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..1eb1a5ebc6787
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesGetByResourceGroupSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.SelectPermissions;
+
+/** Samples for Galleries GetByResourceGroup. */
+public final class GalleriesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryWithSelectPermissions.json
+ */
+ /**
+ * Sample code: Get a gallery with select permissions.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryWithSelectPermissions(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .getByResourceGroupWithResponse(
+ "myResourceGroup", "myGalleryName", SelectPermissions.PERMISSIONS, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGallery.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .getByResourceGroupWithResponse("myResourceGroup", "myGalleryName", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..94bdb0c02bb17
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Galleries ListByResourceGroup. */
+public final class GalleriesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleriesInAResourceGroup.json
+ */
+ /**
+ * Sample code: List galleries in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listGalleriesInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java
new file mode 100644
index 0000000000000..49f25cc9b562c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Galleries List. */
+public final class GalleriesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleriesInASubscription.json
+ */
+ /**
+ * Sample code: List galleries in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listGalleriesInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getGalleries().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java
new file mode 100644
index 0000000000000..bf3acc9e666dc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleriesUpdateSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.GalleryUpdate;
+
+/** Samples for Galleries Update. */
+public final class GalleriesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGallery.json
+ */
+ /**
+ * Sample code: Update a simple gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASimpleGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleries()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ new GalleryUpdate().withDescription("This is the gallery description."),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..9ff81ad98ed17
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsCreateOrUpdateSamples.java
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationVersionInner;
+import com.azure.resourcemanager.compute.models.GalleryApplicationVersionPublishingProfile;
+import com.azure.resourcemanager.compute.models.StorageAccountType;
+import com.azure.resourcemanager.compute.models.TargetRegion;
+import com.azure.resourcemanager.compute.models.UserArtifactManage;
+import com.azure.resourcemanager.compute.models.UserArtifactSource;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for GalleryApplicationVersions CreateOrUpdate. */
+public final class GalleryApplicationVersionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery Application Version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryApplicationVersion(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplicationVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryApplicationName",
+ "1.0.0",
+ new GalleryApplicationVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryApplicationVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)))
+ .withReplicaCount(1)
+ .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z"))
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)
+ .withSource(
+ new UserArtifactSource()
+ .withMediaLink(
+ "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"))
+ .withManageActions(
+ new UserArtifactManage()
+ .withInstall(
+ "powershell -command \"Expand-Archive -Path package.zip -DestinationPath"
+ + " C:\\package\"")
+ .withRemove("del C:\\package "))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java
new file mode 100644
index 0000000000000..8e35e8f791063
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplicationVersions Delete. */
+public final class GalleryApplicationVersionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Delete a gallery Application Version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAGalleryApplicationVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplicationVersions()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java
new file mode 100644
index 0000000000000..773fc6a496c95
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsGetSamples.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.ReplicationStatusTypes;
+
+/** Samples for GalleryApplicationVersions Get. */
+public final class GalleryApplicationVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Get a gallery Application Version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryApplicationVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplicationVersions()
+ .getWithResponse(
+ "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json
+ */
+ /**
+ * Sample code: Get a gallery Application Version with replication status.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryApplicationVersionWithReplicationStatus(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplicationVersions()
+ .getWithResponse(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryApplicationName",
+ "1.0.0",
+ ReplicationStatusTypes.REPLICATION_STATUS,
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java
new file mode 100644
index 0000000000000..f93cc4ccec39f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsListByGalleryApplicationSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplicationVersions ListByGalleryApplication. */
+public final class GalleryApplicationVersionsListByGalleryApplicationSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json
+ */
+ /**
+ * Sample code: List gallery Application Versions in a gallery Application Definition.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listGalleryApplicationVersionsInAGalleryApplicationDefinition(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplicationVersions()
+ .listByGalleryApplication("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java
new file mode 100644
index 0000000000000..bd56f1c1b5848
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationVersionsUpdateSamples.java
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.GalleryApplicationVersionPublishingProfile;
+import com.azure.resourcemanager.compute.models.GalleryApplicationVersionUpdate;
+import com.azure.resourcemanager.compute.models.StorageAccountType;
+import com.azure.resourcemanager.compute.models.TargetRegion;
+import com.azure.resourcemanager.compute.models.UserArtifactManage;
+import com.azure.resourcemanager.compute.models.UserArtifactSource;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for GalleryApplicationVersions Update. */
+public final class GalleryApplicationVersionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json
+ */
+ /**
+ * Sample code: Update a simple gallery Application Version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASimpleGalleryApplicationVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplicationVersions()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryApplicationName",
+ "1.0.0",
+ new GalleryApplicationVersionUpdate()
+ .withPublishingProfile(
+ new GalleryApplicationVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)))
+ .withReplicaCount(1)
+ .withEndOfLifeDate(OffsetDateTime.parse("2019-07-01T07:00:00Z"))
+ .withStorageAccountType(StorageAccountType.STANDARD_LRS)
+ .withSource(
+ new UserArtifactSource()
+ .withMediaLink(
+ "https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"))
+ .withManageActions(
+ new UserArtifactManage()
+ .withInstall(
+ "powershell -command \"Expand-Archive -Path package.zip -DestinationPath"
+ + " C:\\package\"")
+ .withRemove("del C:\\package "))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..18152503a02a6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsCreateOrUpdateSamples.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.GalleryApplicationInner;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+
+/** Samples for GalleryApplications CreateOrUpdate. */
+public final class GalleryApplicationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery Application.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryApplication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplications()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryApplicationName",
+ new GalleryApplicationInner()
+ .withLocation("West US")
+ .withDescription("This is the gallery application description.")
+ .withEula("This is the gallery application EULA.")
+ .withPrivacyStatementUri("myPrivacyStatementUri}")
+ .withReleaseNoteUri("myReleaseNoteUri")
+ .withSupportedOSType(OperatingSystemTypes.WINDOWS),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java
new file mode 100644
index 0000000000000..e0a954f487cfc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplications Delete. */
+public final class GalleryApplicationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryApplication.json
+ */
+ /**
+ * Sample code: Delete a gallery Application.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAGalleryApplication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplications()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java
new file mode 100644
index 0000000000000..19a0811fe09f9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplications Get. */
+public final class GalleryApplicationsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplication.json
+ */
+ /**
+ * Sample code: Get a gallery Application.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryApplication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplications()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryApplicationName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java
new file mode 100644
index 0000000000000..a81daf3863f8e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsListByGallerySamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryApplications ListByGallery. */
+public final class GalleryApplicationsListByGallerySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryApplicationsInAGallery.json
+ */
+ /**
+ * Sample code: List gallery Applications in a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listGalleryApplicationsInAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplications()
+ .listByGallery("myResourceGroup", "myGalleryName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java
new file mode 100644
index 0000000000000..e128d7aa02199
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryApplicationsUpdateSamples.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.GalleryApplicationUpdate;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+
+/** Samples for GalleryApplications Update. */
+public final class GalleryApplicationsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryApplication.json
+ */
+ /**
+ * Sample code: Update a simple gallery Application.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASimpleGalleryApplication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryApplications()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryApplicationName",
+ new GalleryApplicationUpdate()
+ .withDescription("This is the gallery application description.")
+ .withEula("This is the gallery application EULA.")
+ .withPrivacyStatementUri("myPrivacyStatementUri}")
+ .withReleaseNoteUri("myReleaseNoteUri")
+ .withSupportedOSType(OperatingSystemTypes.WINDOWS),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..41be15123dcf0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsCreateOrUpdateSamples.java
@@ -0,0 +1,528 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.GalleryImageVersionInner;
+import com.azure.resourcemanager.compute.models.DataDiskImageEncryption;
+import com.azure.resourcemanager.compute.models.EncryptionImages;
+import com.azure.resourcemanager.compute.models.GalleryArtifactVersionSource;
+import com.azure.resourcemanager.compute.models.GalleryDataDiskImage;
+import com.azure.resourcemanager.compute.models.GalleryImageVersionPublishingProfile;
+import com.azure.resourcemanager.compute.models.GalleryImageVersionStorageProfile;
+import com.azure.resourcemanager.compute.models.GalleryOSDiskImage;
+import com.azure.resourcemanager.compute.models.HostCaching;
+import com.azure.resourcemanager.compute.models.OSDiskImageEncryption;
+import com.azure.resourcemanager.compute.models.ReplicationMode;
+import com.azure.resourcemanager.compute.models.StorageAccountType;
+import com.azure.resourcemanager.compute.models.TargetRegion;
+import java.util.Arrays;
+
+/** Samples for GalleryImageVersions CreateOrUpdate. */
+public final class GalleryImageVersionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithShallowReplicationMode.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using shallow replication mode.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays.asList(new TargetRegion().withName("West US").withRegionalReplicaCount(1)))
+ .withReplicationMode(ReplicationMode.SHALLOW))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVHD.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using vhd as a source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withOsDiskImage(
+ new GalleryOSDiskImage()
+ .withHostCaching(HostCaching.READ_ONLY)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}")
+ .withUri(
+ "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd")))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new GalleryDataDiskImage()
+ .withHostCaching(HostCaching.NONE)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}")
+ .withUri(
+ "https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"))
+ .withLun(1)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using VM as source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingVMAsSource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithImageVersionAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using shared image as source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using mix of disks and snapshots as a source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withOsDiskImage(
+ new GalleryOSDiskImage()
+ .withHostCaching(HostCaching.READ_ONLY)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}")))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new GalleryDataDiskImage()
+ .withHostCaching(HostCaching.NONE)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"))
+ .withLun(1)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithSnapshotsAsSource.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using snapshots as a source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingSnapshotsAsASource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withOsDiskImage(
+ new GalleryOSDiskImage()
+ .withHostCaching(HostCaching.READ_ONLY)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}")))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new GalleryDataDiskImage()
+ .withHostCaching(HostCaching.NONE)
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"))
+ .withLun(1)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Create or update a simple Gallery Image Version using managed image as source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionInner()
+ .withLocation("West US")
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion()
+ .withName("West US")
+ .withRegionalReplicaCount(1)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet")
+ .withLun(1)))),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS)
+ .withEncryption(
+ new EncryptionImages()
+ .withOsDiskImage(
+ new OSDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"))
+ .withDataDiskImages(
+ Arrays
+ .asList(
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet")
+ .withLun(0),
+ new DataDiskImageEncryption()
+ .withDiskEncryptionSetId(
+ "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet")
+ .withLun(1)))))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java
new file mode 100644
index 0000000000000..8571a8aaf638f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImageVersions Delete. */
+public final class GalleryImageVersionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Delete a gallery image version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAGalleryImageVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java
new file mode 100644
index 0000000000000..7139f69d1020e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsGetSamples.java
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.ReplicationStatusTypes;
+
+/** Samples for GalleryImageVersions Get. */
+public final class GalleryImageVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithVhdAsSource.json
+ */
+ /**
+ * Sample code: Get a gallery image version with vhd as a source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryImageVersionWithVhdAsASource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Get a gallery image version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryImageVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json
+ */
+ /**
+ * Sample code: Get a gallery image version with replication status.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryImageVersionWithReplicationStatus(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .getWithResponse(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ ReplicationStatusTypes.REPLICATION_STATUS,
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithSnapshotsAsSource.json
+ */
+ /**
+ * Sample code: Get a gallery image version with snapshots as a source.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryImageVersionWithSnapshotsAsASource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java
new file mode 100644
index 0000000000000..a889b26cbeb11
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsListByGalleryImageSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImageVersions ListByGalleryImage. */
+public final class GalleryImageVersionsListByGalleryImageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json
+ */
+ /**
+ * Sample code: List gallery image versions in a gallery image definition.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listGalleryImageVersionsInAGalleryImageDefinition(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .listByGalleryImage("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java
new file mode 100644
index 0000000000000..a5b577c6d6202
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImageVersionsUpdateSamples.java
@@ -0,0 +1,92 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.GalleryArtifactVersionSource;
+import com.azure.resourcemanager.compute.models.GalleryImageVersionPublishingProfile;
+import com.azure.resourcemanager.compute.models.GalleryImageVersionStorageProfile;
+import com.azure.resourcemanager.compute.models.GalleryImageVersionUpdate;
+import com.azure.resourcemanager.compute.models.StorageAccountType;
+import com.azure.resourcemanager.compute.models.TargetRegion;
+import java.util.Arrays;
+
+/** Samples for GalleryImageVersions Update. */
+public final class GalleryImageVersionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Update a simple Gallery Image Version (Managed Image as source).
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASimpleGalleryImageVersionManagedImageAsSource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionUpdate()
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion().withName("West US").withRegionalReplicaCount(1),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS))))
+ .withStorageProfile(
+ new GalleryImageVersionStorageProfile()
+ .withSource(
+ new GalleryArtifactVersionSource()
+ .withId(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryImageVersionWithoutSourceId.json
+ */
+ /**
+ * Sample code: Update a simple Gallery Image Version without source id.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASimpleGalleryImageVersionWithoutSourceId(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImageVersions()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ "1.0.0",
+ new GalleryImageVersionUpdate()
+ .withPublishingProfile(
+ new GalleryImageVersionPublishingProfile()
+ .withTargetRegions(
+ Arrays
+ .asList(
+ new TargetRegion().withName("West US").withRegionalReplicaCount(1),
+ new TargetRegion()
+ .withName("East US")
+ .withRegionalReplicaCount(2)
+ .withStorageAccountType(StorageAccountType.STANDARD_ZRS))))
+ .withStorageProfile(new GalleryImageVersionStorageProfile()),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..9b41c078a0750
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesCreateOrUpdateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.GalleryImageInner;
+import com.azure.resourcemanager.compute.models.GalleryImageIdentifier;
+import com.azure.resourcemanager.compute.models.HyperVGeneration;
+import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+
+/** Samples for GalleryImages CreateOrUpdate. */
+public final class GalleryImagesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json
+ */
+ /**
+ * Sample code: Create or update a simple gallery image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateASimpleGalleryImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ new GalleryImageInner()
+ .withLocation("West US")
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)
+ .withHyperVGeneration(HyperVGeneration.V1)
+ .withIdentifier(
+ new GalleryImageIdentifier()
+ .withPublisher("myPublisherName")
+ .withOffer("myOfferName")
+ .withSku("mySkuName")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java
new file mode 100644
index 0000000000000..8486a46efdd10
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImages Delete. */
+public final class GalleryImagesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/DeleteAGalleryImage.json
+ */
+ /**
+ * Sample code: Delete a gallery image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAGalleryImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImages()
+ .delete("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java
new file mode 100644
index 0000000000000..00b713c125b1c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImages Get. */
+public final class GalleryImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImage.json
+ */
+ /**
+ * Sample code: Get a gallery image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGalleryImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImages()
+ .getWithResponse("myResourceGroup", "myGalleryName", "myGalleryImageName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java
new file mode 100644
index 0000000000000..bf066b9d3571a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesListByGallerySamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GalleryImages ListByGallery. */
+public final class GalleryImagesListByGallerySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ListGalleryImagesInAGallery.json
+ */
+ /**
+ * Sample code: List gallery images in a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listGalleryImagesInAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImages()
+ .listByGallery("myResourceGroup", "myGalleryName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java
new file mode 100644
index 0000000000000..41a920a9189bb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GalleryImagesUpdateSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.GalleryImageIdentifier;
+import com.azure.resourcemanager.compute.models.GalleryImageUpdate;
+import com.azure.resourcemanager.compute.models.HyperVGeneration;
+import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+
+/** Samples for GalleryImages Update. */
+public final class GalleryImagesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/UpdateASimpleGalleryImage.json
+ */
+ /**
+ * Sample code: Update a simple gallery image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASimpleGalleryImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGalleryImages()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ "myGalleryImageName",
+ new GalleryImageUpdate()
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED)
+ .withHyperVGeneration(HyperVGeneration.V1)
+ .withIdentifier(
+ new GalleryImageIdentifier()
+ .withPublisher("myPublisherName")
+ .withOffer("myOfferName")
+ .withSku("mySkuName")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java
new file mode 100644
index 0000000000000..a7289e20d84b4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/GallerySharingProfileUpdateSamples.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.SharingUpdateInner;
+import com.azure.resourcemanager.compute.models.SharingProfileGroup;
+import com.azure.resourcemanager.compute.models.SharingProfileGroupTypes;
+import com.azure.resourcemanager.compute.models.SharingUpdateOperationTypes;
+import java.util.Arrays;
+
+/** Samples for GallerySharingProfile Update. */
+public final class GallerySharingProfileUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/ResetSharingProfileInAGallery.json
+ */
+ /**
+ * Sample code: reset sharing profile of a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void resetSharingProfileOfAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGallerySharingProfiles()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ new SharingUpdateInner().withOperationType(SharingUpdateOperationTypes.RESET),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/AddToSharingProfileInAGallery.json
+ */
+ /**
+ * Sample code: Add sharing id to the sharing profile of a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void addSharingIdToTheSharingProfileOfAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getGallerySharingProfiles()
+ .update(
+ "myResourceGroup",
+ "myGalleryName",
+ new SharingUpdateInner()
+ .withOperationType(SharingUpdateOperationTypes.ADD)
+ .withGroups(
+ Arrays
+ .asList(
+ new SharingProfileGroup()
+ .withType(SharingProfileGroupTypes.SUBSCRIPTIONS)
+ .withIds(
+ Arrays
+ .asList(
+ "34a4ab42-0d72-47d9-bd1a-aed207386dac",
+ "380fd389-260b-41aa-bad9-0a83108c370b")),
+ new SharingProfileGroup()
+ .withType(SharingProfileGroupTypes.AADTENANTS)
+ .withIds(Arrays.asList("c24c76aa-8897-4027-9b03-8f7928b54ff6")))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..0fd1d9479bb41
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesCreateOrUpdateSamples.java
@@ -0,0 +1,375 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.ImageInner;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.models.ImageDataDisk;
+import com.azure.resourcemanager.compute.models.ImageOSDisk;
+import com.azure.resourcemanager.compute.models.ImageStorageProfile;
+import com.azure.resourcemanager.compute.models.OperatingSystemStateTypes;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+import java.util.Arrays;
+
+/** Samples for Images CreateOrUpdate. */
+public final class ImagesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromASnapshot.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withZoneResilient(false)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromAManagedDisk.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromAManagedDisk(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withZoneResilient(true)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromABlobWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a blob with DiskEncryptionSet resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromAManagedDiskWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a managed disk with DiskEncryptionSet resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"))
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageThatIncludesADataDiskFromABlob.json
+ */
+ /**
+ * Sample code: Create a virtual machine image that includes a data disk from a blob.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageThatIncludesADataDiskFromABlob(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new ImageDataDisk()
+ .withBlobUri(
+ "https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd")
+ .withLun(1)))
+ .withZoneResilient(false)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromASnapshotWithDiskEncryptionSet.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a snapshot with DiskEncryptionSet resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageThatIncludesADataDiskFromASnapshot.json
+ */
+ /**
+ * Sample code: Create a virtual machine image that includes a data disk from a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageThatIncludesADataDiskFromASnapshot(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new ImageDataDisk()
+ .withSnapshot(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"))
+ .withLun(1)))
+ .withZoneResilient(true)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromABlob.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from a blob.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromABlob(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withBlobUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withZoneResilient(true)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageFromAVM.json
+ */
+ /**
+ * Sample code: Create a virtual machine image from an existing virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageFromAnExistingVirtualMachine(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withSourceVirtualMachine(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnImageThatIncludesADataDiskFromAManagedDisk.json
+ */
+ /**
+ * Sample code: Create a virtual machine image that includes a data disk from a managed disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myImage",
+ new ImageInner()
+ .withLocation("West US")
+ .withStorageProfile(
+ new ImageStorageProfile()
+ .withOsDisk(
+ new ImageOSDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"))
+ .withOsType(OperatingSystemTypes.LINUX)
+ .withOsState(OperatingSystemStateTypes.GENERALIZED))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new ImageDataDisk()
+ .withManagedDisk(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"))
+ .withLun(1)))
+ .withZoneResilient(false)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..0b652d8afbfe4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Images GetByResourceGroup. */
+public final class ImagesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetInformationAboutAnImage.json
+ */
+ /**
+ * Sample code: Get information about a virtual machine image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutAVirtualMachineImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .getByResourceGroupWithResponse("myResourceGroup", "myImage", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..899f3cd8aa356
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Images ListByResourceGroup. */
+public final class ImagesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListImagesInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all virtual machine images in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllVirtualMachineImagesInAResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesListSamples.java
new file mode 100644
index 0000000000000..d107e05dc19bb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Images List. */
+public final class ImagesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListImagesInASubscription.json
+ */
+ /**
+ * Sample code: List all virtual machine images in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllVirtualMachineImagesInASubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getImages().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesUpdateSamples.java
new file mode 100644
index 0000000000000..21634e30e59ed
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ImagesUpdateSamples.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.HyperVGenerationTypes;
+import com.azure.resourcemanager.compute.models.ImageUpdate;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Images Update. */
+public final class ImagesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/UpdateImage.json
+ */
+ /**
+ * Sample code: Updates tags of an Image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updatesTagsOfAnImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getImages()
+ .update(
+ "myResourceGroup",
+ "myImage",
+ new ImageUpdate()
+ .withTags(mapOf("department", "HR"))
+ .withSourceVirtualMachine(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"))
+ .withHyperVGeneration(HyperVGenerationTypes.V1),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/LogAnalyticsExportRequestRateByIntervalSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/LogAnalyticsExportRequestRateByIntervalSamples.java
new file mode 100644
index 0000000000000..15f821159cf4d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/LogAnalyticsExportRequestRateByIntervalSamples.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.IntervalInMins;
+import com.azure.resourcemanager.compute.models.RequestRateByIntervalInput;
+import java.time.OffsetDateTime;
+
+/** Samples for LogAnalytics ExportRequestRateByInterval. */
+public final class LogAnalyticsExportRequestRateByIntervalSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/LogAnalyticsRequestRateByInterval.json
+ */
+ /**
+ * Sample code: Export logs which contain all Api requests made to Compute Resource Provider within the given time
+ * period broken down by intervals.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void
+ exportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getLogAnalytics()
+ .exportRequestRateByInterval(
+ "westus",
+ new RequestRateByIntervalInput()
+ .withBlobContainerSasUri("https://somesasuri")
+ .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z"))
+ .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z"))
+ .withGroupByResourceName(true)
+ .withIntervalLength(IntervalInMins.FIVE_MINS),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/LogAnalyticsExportThrottledRequestsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/LogAnalyticsExportThrottledRequestsSamples.java
new file mode 100644
index 0000000000000..0d3ecdf68d9e8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/LogAnalyticsExportThrottledRequestsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.ThrottledRequestsInput;
+import java.time.OffsetDateTime;
+
+/** Samples for LogAnalytics ExportThrottledRequests. */
+public final class LogAnalyticsExportThrottledRequestsSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/LogAnalyticsThrottledRequests.json
+ */
+ /**
+ * Sample code: Export logs which contain all throttled Api requests made to Compute Resource Provider within the
+ * given time period.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void
+ exportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getLogAnalytics()
+ .exportThrottledRequests(
+ "westus",
+ new ThrottledRequestsInput()
+ .withBlobContainerSasUri("https://somesasuri")
+ .withFromTime(OffsetDateTime.parse("2018-01-21T01:54:06.862601Z"))
+ .withToTime(OffsetDateTime.parse("2018-01-23T01:54:06.862601Z"))
+ .withGroupByOperationName(true)
+ .withGroupByResourceName(false)
+ .withGroupByClientApplicationId(false)
+ .withGroupByUserAgent(false),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5c80c6a27e796
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsCreateOrUpdateSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.ProximityPlacementGroupInner;
+import com.azure.resourcemanager.compute.models.ProximityPlacementGroupType;
+
+/** Samples for ProximityPlacementGroups CreateOrUpdate. */
+public final class ProximityPlacementGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create or Update a proximity placement group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateAProximityPlacementGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getProximityPlacementGroups()
+ .createOrUpdateWithResponse(
+ "myResourceGroup",
+ "myProximityPlacementGroup",
+ new ProximityPlacementGroupInner()
+ .withLocation("westus")
+ .withProximityPlacementGroupType(ProximityPlacementGroupType.STANDARD),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsDeleteSamples.java
new file mode 100644
index 0000000000000..9c5c47794a920
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups Delete. */
+public final class ProximityPlacementGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/DeleteAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAProximityPlacementGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getProximityPlacementGroups()
+ .deleteWithResponse("myResourceGroup", "myProximityPlacementGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..a564867a70a8a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups GetByResourceGroup. */
+public final class ProximityPlacementGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAProximityPlacementGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getProximityPlacementGroups()
+ .getByResourceGroupWithResponse("myResourceGroup", "myProximityPlacementGroup", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..8fac8d9d6488d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups ListByResourceGroup. */
+public final class ProximityPlacementGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListProximityPlacementGroupsInAResourceGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAProximityPlacementGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getProximityPlacementGroups()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsListSamples.java
new file mode 100644
index 0000000000000..6e4333f91291c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ProximityPlacementGroups List. */
+public final class ProximityPlacementGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListProximityPlacementGroupsInASubscription.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAProximityPlacementGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getProximityPlacementGroups().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsUpdateSamples.java
new file mode 100644
index 0000000000000..03277d5e3ea19
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ProximityPlacementGroupsUpdateSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.ProximityPlacementGroupUpdate;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ProximityPlacementGroups Update. */
+public final class ProximityPlacementGroupsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/PatchAProximityPlacementGroup.json
+ */
+ /**
+ * Sample code: Create a proximity placement group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAProximityPlacementGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getProximityPlacementGroups()
+ .updateWithResponse(
+ "myResourceGroup",
+ "myProximityPlacementGroup",
+ new ProximityPlacementGroupUpdate().withTags(mapOf("additionalProp1", "string")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ResourceSkusListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ResourceSkusListSamples.java
new file mode 100644
index 0000000000000..2c8e8fd5ef067
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/ResourceSkusListSamples.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ResourceSkus List. */
+public final class ResourceSkusListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json
+ */
+ /**
+ * Sample code: Lists all available Resource SKUs.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllAvailableResourceSKUs(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getResourceSkus().list(null, null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json
+ */
+ /**
+ * Sample code: Lists all available Resource SKUs for the specified region.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllAvailableResourceSKUsForTheSpecifiedRegion(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getResourceSkus()
+ .list("location eq 'westus'", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json
+ */
+ /**
+ * Sample code: Lists all available Resource SKUs with Extended Location information.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllAvailableResourceSKUsWithExtendedLocationInformation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getResourceSkus().list(null, "true", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5280aaaf5383c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsCreateOrUpdateSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.RestorePointCollectionInner;
+import com.azure.resourcemanager.compute.models.RestorePointCollectionSourceProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for RestorePointCollections CreateOrUpdate. */
+public final class RestorePointCollectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateARestorePointCollection.json
+ */
+ /**
+ * Sample code: Create or update a restore point collection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateARestorePointCollection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getRestorePointCollections()
+ .createOrUpdateWithResponse(
+ "myResourceGroup",
+ "myRpc",
+ new RestorePointCollectionInner()
+ .withLocation("norwayeast")
+ .withTags(mapOf("myTag1", "tagValue1"))
+ .withSource(
+ new RestorePointCollectionSourceProperties()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..fccb238a4c7de
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsGetByResourceGroupSamples.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections GetByResourceGroup. */
+public final class RestorePointCollectionsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetRestorePointCollectionWithContainedRestorePoints.json
+ */
+ /**
+ * Sample code: Get a restore point collection, including the restore points contained in the restore point
+ * collection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getRestorePointCollections()
+ .getByResourceGroupWithResponse("myResourceGroup", "rpcName", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetRestorePointCollection.json
+ */
+ /**
+ * Sample code: Get a restore point collection (but not the restore points contained in the restore point
+ * collection).
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getRestorePointCollections()
+ .getByResourceGroupWithResponse("myResourceGroup", "myRpc", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..9050f965ed4ed
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections ListByResourceGroup. */
+public final class RestorePointCollectionsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetRestorePointCollectionsInAResourceGroup.json
+ */
+ /**
+ * Sample code: Gets the list of restore point collections in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getsTheListOfRestorePointCollectionsInAResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getRestorePointCollections()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsListSamples.java
new file mode 100644
index 0000000000000..0c04da95a81c7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointCollectionsListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorePointCollections List. */
+public final class RestorePointCollectionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetRestorePointCollectionsInASubscription.json
+ */
+ /**
+ * Sample code: Gets the list of restore point collections in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getsTheListOfRestorePointCollectionsInASubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getRestorePointCollections().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointsCreateSamples.java
new file mode 100644
index 0000000000000..43f929407cec4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointsCreateSamples.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.RestorePointInner;
+import com.azure.resourcemanager.compute.models.ApiEntityReference;
+import java.util.Arrays;
+
+/** Samples for RestorePoints Create. */
+public final class RestorePointsCreateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateARestorePoint.json
+ */
+ /**
+ * Sample code: Create a restore point.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createARestorePoint(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getRestorePoints()
+ .create(
+ "myResourceGroup",
+ "rpcName",
+ "rpName",
+ new RestorePointInner()
+ .withExcludeDisks(
+ Arrays
+ .asList(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointsGetSamples.java
new file mode 100644
index 0000000000000..d957b1410528f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/RestorePointsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorePoints Get. */
+public final class RestorePointsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetRestorePoint.json
+ */
+ /**
+ * Sample code: Get a restore point.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getARestorePoint(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getRestorePoints()
+ .getWithResponse("myResourceGroup", "rpcName", "rpName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java
new file mode 100644
index 0000000000000..628be8e3b1004
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleries Get. */
+public final class SharedGalleriesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSharedGalleries()
+ .getWithResponse("myLocation", "galleryUniqueName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java
new file mode 100644
index 0000000000000..79a6276f60d42
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleriesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleries List. */
+public final class SharedGalleriesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getSharedGalleries().list("myLocation", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java
new file mode 100644
index 0000000000000..9807d36b121f9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImageVersions Get. */
+public final class SharedGalleryImageVersionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSharedGalleryImageVersions()
+ .getWithResponse(
+ "myLocation", "galleryUniqueName", "myGalleryImageName", "myGalleryImageVersionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java
new file mode 100644
index 0000000000000..95d7c44a32df1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImageVersionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImageVersions List. */
+public final class SharedGalleryImageVersionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSharedGalleryImageVersions()
+ .list("myLocation", "galleryUniqueName", "myGalleryImageName", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java
new file mode 100644
index 0000000000000..1583ad6a0bda7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImages Get. */
+public final class SharedGalleryImagesGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSharedGalleryImages()
+ .getWithResponse("myLocation", "galleryUniqueName", "myGalleryImageName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java
new file mode 100644
index 0000000000000..db3a0ef27aed3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SharedGalleryImagesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SharedGalleryImages List. */
+public final class SharedGalleryImagesListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json
+ */
+ /**
+ * Sample code: Get a gallery.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSharedGalleryImages()
+ .list("myLocation", "galleryUniqueName", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..a8db273d5b3e9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsCreateOrUpdateSamples.java
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.SnapshotInner;
+import com.azure.resourcemanager.compute.models.CreationData;
+import com.azure.resourcemanager.compute.models.DiskCreateOption;
+
+/** Samples for Snapshots CreateOrUpdate. */
+public final class SnapshotsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateASnapshotFromAnExistingSnapshot.json
+ */
+ /**
+ * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .createOrUpdate(
+ "myResourceGroup",
+ "mySnapshot2",
+ new SnapshotInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY)
+ .withSourceResourceId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateASnapshotFromAnExistingSnapshotInDifferentRegion.json
+ */
+ /**
+ * Sample code: Create a snapshot from an existing snapshot in the same or a different subscription in a different
+ * region.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .createOrUpdate(
+ "myResourceGroup",
+ "mySnapshot2",
+ new SnapshotInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.COPY_START)
+ .withSourceResourceId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription.json
+ */
+ /**
+ * Sample code: Create a snapshot by importing an unmanaged blob from the same subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .createOrUpdate(
+ "myResourceGroup",
+ "mySnapshot1",
+ new SnapshotInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json
+ */
+ /**
+ * Sample code: Create a snapshot by importing an unmanaged blob from a different subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .createOrUpdate(
+ "myResourceGroup",
+ "mySnapshot1",
+ new SnapshotInner()
+ .withLocation("West US")
+ .withCreationData(
+ new CreationData()
+ .withCreateOption(DiskCreateOption.IMPORT)
+ .withStorageAccountId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")
+ .withSourceUri("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsDeleteSamples.java
new file mode 100644
index 0000000000000..05cd430a9719f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots Delete. */
+public final class SnapshotsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/DeleteASnapshot.json
+ */
+ /**
+ * Sample code: Delete a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .delete("myResourceGroup", "mySnapshot", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..a367a617587df
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots GetByResourceGroup. */
+public final class SnapshotsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/GetInformationAboutASnapshot.json
+ */
+ /**
+ * Sample code: Get information about a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInformationAboutASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .getByResourceGroupWithResponse("myResourceGroup", "mySnapshot", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsGrantAccessSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsGrantAccessSamples.java
new file mode 100644
index 0000000000000..948bc75aa3359
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsGrantAccessSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.AccessLevel;
+import com.azure.resourcemanager.compute.models.GrantAccessData;
+
+/** Samples for Snapshots GrantAccess. */
+public final class SnapshotsGrantAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/BeginGetAccessSnapshot.json
+ */
+ /**
+ * Sample code: Get a sas on a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getASasOnASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .grantAccess(
+ "myResourceGroup",
+ "mySnapshot",
+ new GrantAccessData().withAccess(AccessLevel.READ).withDurationInSeconds(300),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..a741213f3851d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots ListByResourceGroup. */
+public final class SnapshotsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListSnapshotsInAResourceGroup.json
+ */
+ /**
+ * Sample code: List all snapshots in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllSnapshotsInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsListSamples.java
new file mode 100644
index 0000000000000..a8323af0c7b0b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots List. */
+public final class SnapshotsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/ListSnapshotsInASubscription.json
+ */
+ /**
+ * Sample code: List all snapshots in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllSnapshotsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getSnapshots().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsRevokeAccessSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsRevokeAccessSamples.java
new file mode 100644
index 0000000000000..83f9ca31baf98
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsRevokeAccessSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots RevokeAccess. */
+public final class SnapshotsRevokeAccessSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/EndGetAccessSnapshot.json
+ */
+ /**
+ * Sample code: Revoke access to a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void revokeAccessToASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .revokeAccess("myResourceGroup", "mySnapshot", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsUpdateSamples.java
new file mode 100644
index 0000000000000..c21e1ad4080fb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SnapshotsUpdateSamples.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.SnapshotUpdate;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Snapshots Update. */
+public final class SnapshotsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-04-01/examples/UpdateASnapshot.json
+ */
+ /**
+ * Sample code: Update a snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateASnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .update(
+ "myResourceGroup",
+ "mySnapshot",
+ new SnapshotUpdate()
+ .withTags(mapOf("department", "Development", "project", "UpdateSnapshots"))
+ .withDiskSizeGB(20),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysCreateSamples.java
new file mode 100644
index 0000000000000..d47f99e019a92
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysCreateSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.SshPublicKeyResourceInner;
+
+/** Samples for SshPublicKeys Create. */
+public final class SshPublicKeysCreateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAnSshPublicKey.json
+ */
+ /**
+ * Sample code: Create a new SSH public key resource.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createANewSSHPublicKeyResource(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSshPublicKeys()
+ .createWithResponse(
+ "myResourceGroup",
+ "mySshPublicKeyName",
+ new SshPublicKeyResourceInner().withLocation("westus").withPublicKey("{ssh-rsa public key}"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysGenerateKeyPairSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysGenerateKeyPairSamples.java
new file mode 100644
index 0000000000000..4a1faea066f4f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysGenerateKeyPairSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys GenerateKeyPair. */
+public final class SshPublicKeysGenerateKeyPairSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GenerateSshKeyPair.json
+ */
+ /**
+ * Sample code: Generate an SSH key pair.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void generateAnSSHKeyPair(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSshPublicKeys()
+ .generateKeyPairWithResponse("myResourceGroup", "mySshPublicKeyName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..49027321443cd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/SshPublicKeysGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SshPublicKeys GetByResourceGroup. */
+public final class SshPublicKeysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetAnSshPublicKey.json
+ */
+ /**
+ * Sample code: Get an ssh public key.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAnSshPublicKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getSshPublicKeys()
+ .getByResourceGroupWithResponse("myResourceGroup", "mySshPublicKeyName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineExtensionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineExtensionsUpdateSamples.java
new file mode 100644
index 0000000000000..0cabf4eeaf297
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineExtensionsUpdateSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.models.VirtualMachineExtensionUpdate;
+import java.io.IOException;
+
+/** Samples for VirtualMachineExtensions Update. */
+public final class VirtualMachineExtensionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/UpdateVMExtensionWithSuppressFailureEnabled.json
+ */
+ /**
+ * Sample code: Update VM extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateVMExtension(com.azure.resourcemanager.AzureResourceManager azure) throws IOException {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineExtensions()
+ .update(
+ "myResourceGroup",
+ "myVM",
+ "myVMExtension",
+ new VirtualMachineExtensionUpdate()
+ .withPublisher("extPublisher")
+ .withType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON))
+ .withSuppressFailures(true),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..c994bd9aed1dc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsCreateOrUpdateSamples.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner;
+import com.azure.resourcemanager.compute.models.RunCommandInputParameter;
+import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandScriptSource;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineRunCommands CreateOrUpdate. */
+public final class VirtualMachineRunCommandsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/CreateOrUpdateRunCommand.json
+ */
+ /**
+ * Sample code: Create or update a run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateARunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ "myRunCommand",
+ new VirtualMachineRunCommandInner()
+ .withLocation("West US")
+ .withSource(new VirtualMachineRunCommandScriptSource().withScript("Write-Host Hello World!"))
+ .withParameters(
+ Arrays
+ .asList(
+ new RunCommandInputParameter().withName("param1").withValue("value1"),
+ new RunCommandInputParameter().withName("param2").withValue("value2")))
+ .withAsyncExecution(false)
+ .withRunAsUser("user1")
+ .withRunAsPassword("")
+ .withTimeoutInSeconds(3600),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsDeleteSamples.java
new file mode 100644
index 0000000000000..c9ecd75ad8528
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands Delete. */
+public final class VirtualMachineRunCommandsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/DeleteRunCommand.json
+ */
+ /**
+ * Sample code: Delete a run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteARunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .delete("myResourceGroup", "myVM", "myRunCommand", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java
new file mode 100644
index 0000000000000..e6d34273f767c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsGetByVirtualMachineSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands GetByVirtualMachine. */
+public final class VirtualMachineRunCommandsGetByVirtualMachineSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/GetRunCommand.json
+ */
+ /**
+ * Sample code: Get a run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getARunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .getByVirtualMachineWithResponse("myResourceGroup", "myVM", "myRunCommand", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsGetSamples.java
new file mode 100644
index 0000000000000..ef15f67c669ec
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands Get. */
+public final class VirtualMachineRunCommandsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/VirtualMachineRunCommandGet.json
+ */
+ /**
+ * Sample code: VirtualMachineRunCommandGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void virtualMachineRunCommandGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .getWithResponse("SoutheastAsia", "RunPowerShellScript", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java
new file mode 100644
index 0000000000000..64e8a14e0c181
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsListByVirtualMachineSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands ListByVirtualMachine. */
+public final class VirtualMachineRunCommandsListByVirtualMachineSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/ListRunCommandsInVM.json
+ */
+ /**
+ * Sample code: List run commands in a Virtual Machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listRunCommandsInAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .listByVirtualMachine("myResourceGroup", "myVM", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsListSamples.java
new file mode 100644
index 0000000000000..828ed8fbb962d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineRunCommands List. */
+public final class VirtualMachineRunCommandsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/VirtualMachineRunCommandList.json
+ */
+ /**
+ * Sample code: VirtualMachineRunCommandList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void virtualMachineRunCommandList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .list("SoutheastAsia", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsUpdateSamples.java
new file mode 100644
index 0000000000000..deab555352922
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineRunCommandsUpdateSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandScriptSource;
+import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate;
+
+/** Samples for VirtualMachineRunCommands Update. */
+public final class VirtualMachineRunCommandsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/UpdateRunCommand.json
+ */
+ /**
+ * Sample code: Update a run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateARunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineRunCommands()
+ .update(
+ "myResourceGroup",
+ "myVM",
+ "myRunCommand",
+ new VirtualMachineRunCommandUpdate()
+ .withSource(
+ new VirtualMachineRunCommandScriptSource().withScript("Write-Host Script Source Updated!")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java
new file mode 100644
index 0000000000000..a2432f63c8528
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetRollingUpgrades StartExtensionUpgrade. */
+public final class VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/VMScaleSetExtensionRollingUpgrade.json
+ */
+ /**
+ * Sample code: Start an extension rolling upgrade.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void startAnExtensionRollingUpgrade(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetRollingUpgrades()
+ .startExtensionUpgrade("myResourceGroup", "{vmss-name}", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..2f97d44b66751
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetVMExtensionInner;
+import java.io.IOException;
+
+/** Samples for VirtualMachineScaleSetVMExtensions CreateOrUpdate. */
+public final class VirtualMachineScaleSetVMExtensionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Create VirtualMachineScaleSet VM extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createVirtualMachineScaleSetVMExtension(com.azure.resourcemanager.AzureResourceManager azure)
+ throws IOException {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMExtensions()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myvmScaleSet",
+ "0",
+ "myVMExtension",
+ new VirtualMachineScaleSetVMExtensionInner()
+ .withPublisher("extPublisher")
+ .withTypePropertiesType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize(
+ "{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java
new file mode 100644
index 0000000000000..2dee6ffdd5879
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMExtensions Delete. */
+public final class VirtualMachineScaleSetVMExtensionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/DeleteVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Delete VirtualMachineScaleSet VM extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteVirtualMachineScaleSetVMExtension(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMExtensions()
+ .delete("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsGetSamples.java
new file mode 100644
index 0000000000000..2b67800da1ffb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMExtensions Get. */
+public final class VirtualMachineScaleSetVMExtensionsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Get VirtualMachineScaleSet VM extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getVirtualMachineScaleSetVMExtension(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMExtensions()
+ .getWithResponse("myResourceGroup", "myvmScaleSet", "0", "myVMExtension", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsListSamples.java
new file mode 100644
index 0000000000000..7136af288fe73
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMExtensions List. */
+public final class VirtualMachineScaleSetVMExtensionsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: List extensions in Vmss instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExtensionsInVmssInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMExtensions()
+ .listWithResponse("myResourceGroup", "myvmScaleSet", "0", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.java
new file mode 100644
index 0000000000000..7a7eeccbee989
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMExtensionsUpdateSamples.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMExtensionUpdate;
+import java.io.IOException;
+
+/** Samples for VirtualMachineScaleSetVMExtensions Update. */
+public final class VirtualMachineScaleSetVMExtensionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/UpdateVirtualMachineScaleSetVMExtensions.json
+ */
+ /**
+ * Sample code: Update VirtualMachineScaleSet VM extension.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateVirtualMachineScaleSetVMExtension(com.azure.resourcemanager.AzureResourceManager azure)
+ throws IOException {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMExtensions()
+ .update(
+ "myResourceGroup",
+ "myvmScaleSet",
+ "0",
+ "myVMExtension",
+ new VirtualMachineScaleSetVMExtensionUpdate()
+ .withPublisher("extPublisher")
+ .withTypePropertiesType("extType")
+ .withTypeHandlerVersion("1.2")
+ .withAutoUpgradeMinorVersion(true)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize(
+ "{\"UserName\":\"xyz@microsoft.com\"}", Object.class, SerializerEncoding.JSON)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..1724a8360a6ec
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineRunCommandInner;
+import com.azure.resourcemanager.compute.models.RunCommandInputParameter;
+import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandScriptSource;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands CreateOrUpdate. */
+public final class VirtualMachineScaleSetVMRunCommandsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/CreateOrUpdateVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Create VirtualMachineScaleSet VM run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createVirtualMachineScaleSetVMRunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMRunCommands()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myvmScaleSet",
+ "0",
+ "myRunCommand",
+ new VirtualMachineRunCommandInner()
+ .withLocation("West US")
+ .withSource(new VirtualMachineRunCommandScriptSource().withScript("Write-Host Hello World!"))
+ .withParameters(
+ Arrays
+ .asList(
+ new RunCommandInputParameter().withName("param1").withValue("value1"),
+ new RunCommandInputParameter().withName("param2").withValue("value2")))
+ .withAsyncExecution(false)
+ .withRunAsUser("user1")
+ .withRunAsPassword("")
+ .withTimeoutInSeconds(3600),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java
new file mode 100644
index 0000000000000..22b94f7824f7f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands Delete. */
+public final class VirtualMachineScaleSetVMRunCommandsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/DeleteVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Delete VirtualMachineScaleSet VM run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteVirtualMachineScaleSetVMRunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMRunCommands()
+ .delete("myResourceGroup", "myvmScaleSet", "0", "myRunCommand", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.java
new file mode 100644
index 0000000000000..b39eb6111b1b2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands Get. */
+public final class VirtualMachineScaleSetVMRunCommandsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/GetVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Get VirtualMachineScaleSet VM run commands.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getVirtualMachineScaleSetVMRunCommands(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMRunCommands()
+ .getWithResponse("myResourceGroup", "myvmScaleSet", "0", "myRunCommand", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java
new file mode 100644
index 0000000000000..b4684bf93061b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands List. */
+public final class VirtualMachineScaleSetVMRunCommandsListSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/ListVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: List run commands in Vmss instance.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listRunCommandsInVmssInstance(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMRunCommands()
+ .list("myResourceGroup", "myvmScaleSet", "0", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.java
new file mode 100644
index 0000000000000..a7f4ee22596fc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMRunCommandsUpdateSamples.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandScriptSource;
+import com.azure.resourcemanager.compute.models.VirtualMachineRunCommandUpdate;
+
+/** Samples for VirtualMachineScaleSetVMRunCommands Update. */
+public final class VirtualMachineScaleSetVMRunCommandsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/UpdateVirtualMachineScaleSetVMRunCommands.json
+ */
+ /**
+ * Sample code: Update VirtualMachineScaleSet VM run command.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateVirtualMachineScaleSetVMRunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMRunCommands()
+ .update(
+ "myResourceGroup",
+ "myvmScaleSet",
+ "0",
+ "myRunCommand",
+ new VirtualMachineRunCommandUpdate()
+ .withSource(
+ new VirtualMachineRunCommandScriptSource().withScript("Write-Host Script Source Updated!")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsDeleteSamples.java
new file mode 100644
index 0000000000000..948acd0cb6d49
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Delete. */
+public final class VirtualMachineScaleSetVMsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json
+ */
+ /**
+ * Sample code: Force Delete a virtual machine from a VM scale set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void forceDeleteAVirtualMachineFromAVMScaleSet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMs()
+ .delete("myResourceGroup", "myvmScaleSet", "0", true, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.java
new file mode 100644
index 0000000000000..fdfc66ec65c28
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsGetInstanceViewSamples.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs GetInstanceView. */
+public final class VirtualMachineScaleSetVMsGetInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineScaleSetVMInstanceViewAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get instance view of a virtual machine from a VM scale set placed on a dedicated host group through
+ * automatic placement.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void
+ getInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMs()
+ .getInstanceViewWithResponse("myResourceGroup", "myVirtualMachineScaleSet", "0", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsGetSamples.java
new file mode 100644
index 0000000000000..7e28c293ed0d0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs Get. */
+public final class VirtualMachineScaleSetVMsGetSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineScaleSetVMWithUserData.json
+ */
+ /**
+ * Sample code: Get VM scale set VM with UserData.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getVMScaleSetVMWithUserData(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMs()
+ .getWithResponse("myResourceGroup", "{vmss-name}", "0", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.java
new file mode 100644
index 0000000000000..419f1b9954606
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs RetrieveBootDiagnosticsData. */
+public final class VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json
+ */
+ /**
+ * Sample code: RetrieveBootDiagnosticsData of a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void retrieveBootDiagnosticsDataOfAVirtualMachine(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMs()
+ .retrieveBootDiagnosticsDataWithResponse("ResourceGroup", "myvmScaleSet", "0", 60, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsRunCommandSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsRunCommandSamples.java
new file mode 100644
index 0000000000000..28d1626589312
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsRunCommandSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.RunCommandInput;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSetVMs RunCommand. */
+public final class VirtualMachineScaleSetVMsRunCommandSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/VMScaleSetRunCommand.json
+ */
+ /**
+ * Sample code: VirtualMachineScaleSetVMs_RunCommand.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void virtualMachineScaleSetVMsRunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMs()
+ .runCommand(
+ "myResourceGroup",
+ "myVirtualMachineScaleSet",
+ "0",
+ new RunCommandInput()
+ .withCommandId("RunPowerShellScript")
+ .withScript(Arrays.asList("Write-Host Hello World!")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.java
new file mode 100644
index 0000000000000..51040698fb0e9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetVMsSimulateEvictionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSetVMs SimulateEviction. */
+public final class VirtualMachineScaleSetVMsSimulateEvictionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/SimulateEvictionOfVmssVM.json
+ */
+ /**
+ * Sample code: Simulate Eviction a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void simulateEvictionAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSetVMs()
+ .simulateEvictionWithResponse("ResourceGroup", "VmScaleSetName", "InstanceId", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..9c3c5beb69221
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsCreateOrUpdateSamples.java
@@ -0,0 +1,2235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetExtensionInner;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineScaleSetInner;
+import com.azure.resourcemanager.compute.models.ApiEntityReference;
+import com.azure.resourcemanager.compute.models.ApplicationProfile;
+import com.azure.resourcemanager.compute.models.AutomaticRepairsPolicy;
+import com.azure.resourcemanager.compute.models.BillingProfile;
+import com.azure.resourcemanager.compute.models.BootDiagnostics;
+import com.azure.resourcemanager.compute.models.CachingTypes;
+import com.azure.resourcemanager.compute.models.CapacityReservationProfile;
+import com.azure.resourcemanager.compute.models.DiagnosticsProfile;
+import com.azure.resourcemanager.compute.models.DiffDiskOptions;
+import com.azure.resourcemanager.compute.models.DiffDiskPlacement;
+import com.azure.resourcemanager.compute.models.DiffDiskSettings;
+import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.models.ImageReference;
+import com.azure.resourcemanager.compute.models.IpVersion;
+import com.azure.resourcemanager.compute.models.LinuxConfiguration;
+import com.azure.resourcemanager.compute.models.Plan;
+import com.azure.resourcemanager.compute.models.ScaleInPolicy;
+import com.azure.resourcemanager.compute.models.ScheduledEventsProfile;
+import com.azure.resourcemanager.compute.models.SecurityProfile;
+import com.azure.resourcemanager.compute.models.SecurityTypes;
+import com.azure.resourcemanager.compute.models.Sku;
+import com.azure.resourcemanager.compute.models.SpotRestorePolicy;
+import com.azure.resourcemanager.compute.models.SshConfiguration;
+import com.azure.resourcemanager.compute.models.SshPublicKey;
+import com.azure.resourcemanager.compute.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.models.TerminateNotificationProfile;
+import com.azure.resourcemanager.compute.models.UefiSettings;
+import com.azure.resourcemanager.compute.models.UpgradeMode;
+import com.azure.resourcemanager.compute.models.UpgradePolicy;
+import com.azure.resourcemanager.compute.models.VMGalleryApplication;
+import com.azure.resourcemanager.compute.models.VirtualHardDisk;
+import com.azure.resourcemanager.compute.models.VirtualMachineEvictionPolicyTypes;
+import com.azure.resourcemanager.compute.models.VirtualMachinePriorityTypes;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetDataDisk;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetExtensionProfile;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetIpConfiguration;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetManagedDiskParameters;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkConfiguration;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetNetworkProfile;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetOSDisk;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetOSProfile;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetPublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetScaleInRules;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetStorageProfile;
+import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMProfile;
+import java.io.IOException;
+import java.util.Arrays;
+
+/** Samples for VirtualMachineScaleSets CreateOrUpdate. */
+public final class VirtualMachineScaleSetsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithEmptyDataDisksOnEachVm.json
+ */
+ /**
+ * Sample code: Create a scale set with empty data disks on each vm.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithEmptyDataDisksOnEachVm(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D2_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiskSizeGB(512)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAScaleSetWithUserData.json
+ */
+ /**
+ * Sample code: Create a scale set with userData.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithUserData(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withUserData("RXhhbXBsZSBVc2VyRGF0YQ=="))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetFromWithFpgaNetworkInterface.json
+ */
+ /**
+ * Sample code: Create a scale set with Fpga Network Interfaces.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithFpgaNetworkInterfaces(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true),
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{fpgaNic-Name}")
+ .withPrimary(false)
+ .withEnableAcceleratedNetworking(false)
+ .withEnableFpga(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{fpgaNic-Name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"))
+ .withPrimary(true)
+ .withPrivateIpAddressVersion(IpVersion.IPV4)))
+ .withEnableIpForwarding(false)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetFromACustomImage.json
+ */
+ /**
+ * Sample code: Create a scale set from a custom image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetFromACustomImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithDiffOsDiskUsingDiffDiskPlacement.json
+ */
+ /**
+ * Sample code: Create a scale set with ephemeral os disks using placement property.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithEphemeralOsDisksUsingPlacementProperty(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.RESOURCE_DISK))
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithScaleInPolicy.json
+ */
+ /**
+ * Sample code: Create a scale set with scaleInPolicy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithScaleInPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true)
+ .withScaleInPolicy(
+ new ScaleInPolicy()
+ .withRules(Arrays.asList(VirtualMachineScaleSetScaleInRules.OLDEST_VM))
+ .withForceDeletion(true)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithEncryptionAtHost.json
+ */
+ /**
+ * Sample code: Create a scale set with Host Encryption using encryptionAtHost property.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true)))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithAnAzureLoadBalancer.json
+ */
+ /**
+ * Sample code: Create a scale set with an azure load balancer.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithAnAzureLoadBalancer(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))
+ .withPublicIpAddressConfiguration(
+ new VirtualMachineScaleSetPublicIpAddressConfiguration()
+ .withName("{vmss-name}")
+ .withPublicIpAddressVersion(IpVersion.IPV4))
+ .withLoadBalancerBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}")))
+ .withLoadBalancerInboundNatPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}")))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithManagedBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a scale set with managed boot diagnostics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithManagedBootDiagnostics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithAMarketplaceImagePlan.json
+ */
+ /**
+ * Sample code: Create a scale set with a marketplace image plan.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithAMarketplaceImagePlan(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithDiffOsDisk.json
+ */
+ /**
+ * Sample code: Create a scale set with ephemeral os disks.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithEphemeralOsDisks(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiffDiskSettings(
+ new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL))
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithVMsInDifferentZones.json
+ */
+ /**
+ * Sample code: Create a scale set with virtual machines in different zones.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithVirtualMachinesInDifferentZones(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("centralus")
+ .withSku(new Sku().withName("Standard_A1_v2").withTier("Standard").withCapacity(2L))
+ .withZones(Arrays.asList("1", "3"))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withDiskSizeGB(512)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAScaleSetWithCapacityReservation.json
+ */
+ /**
+ * Sample code: Create or update a scale set with capacity reservation.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateAScaleSetWithCapacityReservation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withCapacityReservation(
+ new CapacityReservationProfile()
+ .withCapacityReservationGroup(
+ new SubResource()
+ .withId(
+ "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithSshAuthentication.json
+ */
+ /**
+ * Sample code: Create a scale set with ssh authentication.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithSshAuthentication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withDisablePasswordAuthentication(true)
+ .withSsh(
+ new SshConfiguration()
+ .withPublicKeys(
+ Arrays
+ .asList(
+ new SshPublicKey()
+ .withPath(
+ "/home/{your-username}/.ssh/authorized_keys")
+ .withKeyData(
+ "ssh-rsa"
+ + " AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"))))))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithAnAzureApplicationGateway.json
+ */
+ /**
+ * Sample code: Create a scale set with an azure application gateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithAnAzureApplicationGateway(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))
+ .withApplicationGatewayBackendAddressPools(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}")))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage.json
+ */
+ /**
+ * Sample code: Create a custom-image scale set from an unmanaged generalized os image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withName("osDisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithExtensionsTimeBudget.json
+ */
+ /**
+ * Sample code: Create a scale set with extension time budget.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithExtensionTimeBudget(com.azure.resourcemanager.AzureResourceManager azure)
+ throws IOException {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionProfile(
+ new VirtualMachineScaleSetExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetExtensionInner()
+ .withName("{extension-name}")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))))
+ .withExtensionsTimeBudget("PT1H20M")))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithApplicationProfile.json
+ */
+ /**
+ * Sample code: Create a scale set with Application Profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithApplicationProfile(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withApplicationProfile(
+ new ApplicationProfile()
+ .withGalleryApplications(
+ Arrays
+ .asList(
+ new VMGalleryApplication()
+ .withTags("myTag1")
+ .withOrder(1)
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0")
+ .withConfigurationReference(
+ "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"),
+ new VMGalleryApplication()
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1")))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScalesetWithDiskEncryptionSetResource.json
+ */
+ /**
+ * Sample code: Create a scale set with DiskEncryptionSet resource in os disk and data disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_DS1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetDataDisk()
+ .withLun(0)
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithPremiumStorage.json
+ */
+ /**
+ * Sample code: Create a scale set with premium storage.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithPremiumStorage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithTerminateScheduledEventEnabled.json
+ */
+ /**
+ * Sample code: Create a scale set with terminate scheduled events enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithTerminateScheduledEventsEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withScheduledEventsProfile(
+ new ScheduledEventsProfile()
+ .withTerminateNotificationProfile(
+ new TerminateNotificationProfile()
+ .withNotBeforeTimeout("PT5M")
+ .withEnable(true))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithExtensionsSuppressFailuresEnabled.json
+ */
+ /**
+ * Sample code: Create a VMSS with an extension that has suppressFailures enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMSSWithAnExtensionThatHasSuppressFailuresEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) throws IOException {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionProfile(
+ new VirtualMachineScaleSetExtensionProfile()
+ .withExtensions(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetExtensionInner()
+ .withName("{extension-name}")
+ .withPublisher("{extension-Publisher}")
+ .withTypePropertiesType("{extension-Type}")
+ .withTypeHandlerVersion("{handler-version}")
+ .withAutoUpgradeMinorVersion(false)
+ .withSettings(
+ SerializerFactory
+ .createDefaultManagementSerializerAdapter()
+ .deserialize("{}", Object.class, SerializerEncoding.JSON))
+ .withSuppressFailures(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAPlatformImageScaleSetWithUnmanagedOsDisks.json
+ */
+ /**
+ * Sample code: Create a platform-image scale set with unmanaged os disks.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAPlatformImageScaleSetWithUnmanagedOsDisks(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withName("osDisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withVhdContainers(
+ Arrays
+ .asList(
+ "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer",
+ "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer",
+ "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer",
+ "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer",
+ "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer"))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithUefiSettings.json
+ */
+ /**
+ * Sample code: Create a scale set with Uefi Settings of secureBoot and vTPM.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithUefiSettingsOfSecureBootAndVTPM(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D2s_v3").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("windowsserver-gen2preview-preview")
+ .withSku("windows10-tvm")
+ .withVersion("18363.592.2001092016"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(
+ new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithPasswordAuthentication.json
+ */
+ /**
+ * Sample code: Create a scale set with password authentication.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithPasswordAuthentication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithAutomaticRepairs.json
+ */
+ /**
+ * Sample code: Create a scale set with automatic repairs enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithAutomaticRepairsEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withAutomaticRepairsPolicy(new AutomaticRepairsPolicy().withEnabled(true).withGracePeriod("PT30M"))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithSpotRestorePolicy.json
+ */
+ /**
+ * Sample code: Create a scale set with spot restore policy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithSpotRestorePolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_A8m_v2").withTier("Standard").withCapacity(2L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withPriority(VirtualMachinePriorityTypes.SPOT)
+ .withEvictionPolicy(VirtualMachineEvictionPolicyTypes.DEALLOCATE)
+ .withBillingProfile(new BillingProfile().withMaxPrice(-1.0)))
+ .withOverprovision(true)
+ .withSpotRestorePolicy(new SpotRestorePolicy().withEnabled(true).withRestoreTimeout("PT1H")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetFromAGeneralizedSharedImage.json
+ */
+ /**
+ * Sample code: Create a scale set from a generalized shared image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetFromAGeneralizedSharedImage(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetWithBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a scale set with boot diagnostics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetWithBootDiagnostics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withOsProfile(
+ new VirtualMachineScaleSetOSProfile()
+ .withComputerNamePrefix("{vmss-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net"))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAScaleSetFromASpecializedSharedImage.json
+ */
+ /**
+ * Sample code: Create a scale set from a specialized shared image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAScaleSetFromASpecializedSharedImage(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vmss-name}",
+ new VirtualMachineScaleSetInner()
+ .withLocation("westus")
+ .withSku(new Sku().withName("Standard_D1_v2").withTier("Standard").withCapacity(3L))
+ .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.MANUAL))
+ .withVirtualMachineProfile(
+ new VirtualMachineScaleSetVMProfile()
+ .withStorageProfile(
+ new VirtualMachineScaleSetStorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new VirtualMachineScaleSetOSDisk()
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new VirtualMachineScaleSetManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new VirtualMachineScaleSetNetworkProfile()
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetNetworkConfiguration()
+ .withName("{vmss-name}")
+ .withPrimary(true)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineScaleSetIpConfiguration()
+ .withName("{vmss-name}")
+ .withSubnet(
+ new ApiEntityReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"))))
+ .withEnableIpForwarding(true)))))
+ .withOverprovision(true),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsDeleteSamples.java
new file mode 100644
index 0000000000000..66f14f506608f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets Delete. */
+public final class VirtualMachineScaleSetsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json
+ */
+ /**
+ * Sample code: Force Delete a VM scale set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void forceDeleteAVMScaleSet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .delete("myResourceGroup", "myvmScaleSet", true, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..157034491063d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsGetByResourceGroupSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets GetByResourceGroup. */
+public final class VirtualMachineScaleSetsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineScaleSetAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get a virtual machine scale set placed on a dedicated host group through automatic placement.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVirtualMachineScaleSet", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineScaleSetWithUserData.json
+ */
+ /**
+ * Sample code: Get a virtual machine scale set with UserData.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAVirtualMachineScaleSetWithUserData(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVirtualMachineScaleSet", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsListByLocationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsListByLocationSamples.java
new file mode 100644
index 0000000000000..47db08f8c7de4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachineScaleSetsListByLocationSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachineScaleSets ListByLocation. */
+public final class VirtualMachineScaleSetsListByLocationSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListVirtualMachineScaleSetsInASubscriptionByLocation.json
+ */
+ /**
+ * Sample code: Lists all the VM scale sets under the specified subscription for the specified location.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachineScaleSets()
+ .listByLocation("eastus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesAssessPatchesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesAssessPatchesSamples.java
new file mode 100644
index 0000000000000..92a79ca283074
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesAssessPatchesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines AssessPatches. */
+public final class VirtualMachinesAssessPatchesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/VirtualMachineAssessPatches.json
+ */
+ /**
+ * Sample code: Assess patch state of a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void assessPatchStateOfAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .assessPatches("myResourceGroupName", "myVMName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..3389ed8f6255b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesCreateOrUpdateSamples.java
@@ -0,0 +1,2297 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner;
+import com.azure.resourcemanager.compute.models.AdditionalCapabilities;
+import com.azure.resourcemanager.compute.models.ApplicationProfile;
+import com.azure.resourcemanager.compute.models.BootDiagnostics;
+import com.azure.resourcemanager.compute.models.CachingTypes;
+import com.azure.resourcemanager.compute.models.CapacityReservationProfile;
+import com.azure.resourcemanager.compute.models.DataDisk;
+import com.azure.resourcemanager.compute.models.DeleteOptions;
+import com.azure.resourcemanager.compute.models.DiagnosticsProfile;
+import com.azure.resourcemanager.compute.models.DiffDiskOptions;
+import com.azure.resourcemanager.compute.models.DiffDiskPlacement;
+import com.azure.resourcemanager.compute.models.DiffDiskSettings;
+import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.models.DiskEncryptionSetParameters;
+import com.azure.resourcemanager.compute.models.HardwareProfile;
+import com.azure.resourcemanager.compute.models.ImageReference;
+import com.azure.resourcemanager.compute.models.LinuxConfiguration;
+import com.azure.resourcemanager.compute.models.LinuxPatchAssessmentMode;
+import com.azure.resourcemanager.compute.models.LinuxPatchSettings;
+import com.azure.resourcemanager.compute.models.LinuxVMGuestPatchMode;
+import com.azure.resourcemanager.compute.models.ManagedDiskParameters;
+import com.azure.resourcemanager.compute.models.NetworkApiVersion;
+import com.azure.resourcemanager.compute.models.NetworkInterfaceReference;
+import com.azure.resourcemanager.compute.models.NetworkProfile;
+import com.azure.resourcemanager.compute.models.OSDisk;
+import com.azure.resourcemanager.compute.models.OSProfile;
+import com.azure.resourcemanager.compute.models.OperatingSystemTypes;
+import com.azure.resourcemanager.compute.models.PatchSettings;
+import com.azure.resourcemanager.compute.models.Plan;
+import com.azure.resourcemanager.compute.models.PublicIpAddressSku;
+import com.azure.resourcemanager.compute.models.PublicIpAddressSkuName;
+import com.azure.resourcemanager.compute.models.PublicIpAddressSkuTier;
+import com.azure.resourcemanager.compute.models.PublicIpAllocationMethod;
+import com.azure.resourcemanager.compute.models.ScheduledEventsProfile;
+import com.azure.resourcemanager.compute.models.SecurityProfile;
+import com.azure.resourcemanager.compute.models.SecurityTypes;
+import com.azure.resourcemanager.compute.models.SshConfiguration;
+import com.azure.resourcemanager.compute.models.SshPublicKey;
+import com.azure.resourcemanager.compute.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.models.StorageProfile;
+import com.azure.resourcemanager.compute.models.TerminateNotificationProfile;
+import com.azure.resourcemanager.compute.models.UefiSettings;
+import com.azure.resourcemanager.compute.models.VMGalleryApplication;
+import com.azure.resourcemanager.compute.models.VMSizeProperties;
+import com.azure.resourcemanager.compute.models.VirtualHardDisk;
+import com.azure.resourcemanager.compute.models.VirtualMachineNetworkInterfaceConfiguration;
+import com.azure.resourcemanager.compute.models.VirtualMachineNetworkInterfaceIpConfiguration;
+import com.azure.resourcemanager.compute.models.VirtualMachinePublicIpAddressConfiguration;
+import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes;
+import com.azure.resourcemanager.compute.models.WindowsConfiguration;
+import com.azure.resourcemanager.compute.models.WindowsPatchAssessmentMode;
+import com.azure.resourcemanager.compute.models.WindowsVMGuestPatchMode;
+import java.util.Arrays;
+
+/** Samples for VirtualMachines CreateOrUpdate. */
+public final class VirtualMachinesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmFromASharedGalleryImage.json
+ */
+ /**
+ * Sample code: Create a VM from a shared gallery image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMFromASharedGalleryImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withSharedGalleryImageId(
+ "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAVmWithVMSizeProperties.json
+ */
+ /**
+ * Sample code: Create a VM with VM Size Properties.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMWithVMSizeProperties(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(
+ new HardwareProfile()
+ .withVmSize(VirtualMachineSizeTypes.STANDARD_D4_V3)
+ .withVmSizeProperties(new VMSizeProperties().withVCpusAvailable(1).withVCpusPerCore(1)))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withUserData("U29tZSBDdXN0b20gRGF0YQ=="),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAPlatformImageVmWithUnmanagedOsAndDataDisks.json
+ */
+ /**
+ * Sample code: Create a platform-image vm with unmanaged os and data disks.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAPlatformImageVmWithUnmanagedOsAndDataDisks(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vm-name}",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"))
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd"))
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new DataDisk()
+ .withLun(1)
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd"))
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateALinuxVmWithPatchSettingModesOfAutomaticByPlatform.json
+ */
+ /**
+ * Sample code: Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("Canonical")
+ .withOffer("UbuntuServer")
+ .withSku("16.04-LTS")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings()
+ .withPatchMode(LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM)
+ .withAssessmentMode(LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json
+ */
+ /**
+ * Sample code: Create a vm with ephemeral os disk provisioning in Cache disk using placement property.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.CACHE_DISK))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithAMarketplaceImagePlan.json
+ */
+ /**
+ * Sample code: Create a vm with a marketplace image plan.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithAMarketplaceImagePlan(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByOS.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByOS.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_OS))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAWindowsVmWithPatchSettingModesOfAutomaticByPlatform.json
+ */
+ /**
+ * Sample code: Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings()
+ .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM)
+ .withAssessmentMode(WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAWindowsVmWithPatchSettingAssessmentModeOfImageDefault.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting assessmentMode of ImageDefault.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings()
+ .withAssessmentMode(WindowsPatchAssessmentMode.IMAGE_DEFAULT))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithPremiumStorage.json
+ */
+ /**
+ * Sample code: Create a vm with premium storage.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithPremiumStorage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAVmWithCapacityReservation.json
+ */
+ /**
+ * Sample code: Create or update a VM with capacity reservation.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateAVMWithCapacityReservation(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withCapacityReservation(
+ new CapacityReservationProfile()
+ .withCapacityReservationGroup(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateALinuxVmWithPatchSettingAssessmentModeOfImageDefault.json
+ */
+ /**
+ * Sample code: Create a Linux vm with a patch setting assessmentMode of ImageDefault.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("Canonical")
+ .withOffer("UbuntuServer")
+ .withSku("16.04-LTS")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings()
+ .withAssessmentMode(LinuxPatchAssessmentMode.IMAGE_DEFAULT))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set
+ * to true.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings()
+ .withPatchMode(WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM)
+ .withEnableHotpatching(true))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithExtensionsTimeBudget.json
+ */
+ /**
+ * Sample code: Create a vm with an extensions time budget.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithAnExtensionsTimeBudget(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withExtensionsTimeBudget("PT30M"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage.json
+ */
+ /**
+ * Sample code: Create a custom-image vm from an unmanaged generalized os image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createACustomImageVmFromAnUnmanagedGeneralizedOsImage(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vm-name}",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withOsDisk(
+ new OSDisk()
+ .withOsType(OperatingSystemTypes.WINDOWS)
+ .withName("myVMosdisk")
+ .withVhd(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"))
+ .withImage(
+ new VirtualHardDisk()
+ .withUri(
+ "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"))
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithEncryptionAtHost.json
+ */
+ /**
+ * Sample code: Create a vm with Host Encryption using encryptionAtHost property.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithHostEncryptionUsingEncryptionAtHostProperty(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withSecurityProfile(new SecurityProfile().withEncryptionAtHost(true)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmInAnAvailabilitySet.json
+ */
+ /**
+ * Sample code: Create a vm in an availability set.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmInAnAvailabilitySet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withAvailabilitySet(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithEmptyDataDisks.json
+ */
+ /**
+ * Sample code: Create a vm with empty data disks.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithEmptyDataDisks(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023),
+ new DataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithNetworkInterfaceConfiguration.json
+ */
+ /**
+ * Sample code: Create a VM with network interface configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMWithNetworkInterfaceConfiguration(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkApiVersion(NetworkApiVersion.TWO_ZERO_TWO_ZERO_ONE_ONE_ZERO_ONE)
+ .withNetworkInterfaceConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineNetworkInterfaceConfiguration()
+ .withName("{nic-config-name}")
+ .withPrimary(true)
+ .withDeleteOption(DeleteOptions.DELETE)
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new VirtualMachineNetworkInterfaceIpConfiguration()
+ .withName("{ip-config-name}")
+ .withPrimary(true)
+ .withPublicIpAddressConfiguration(
+ new VirtualMachinePublicIpAddressConfiguration()
+ .withName("{publicIP-config-name}")
+ .withSku(
+ new PublicIpAddressSku()
+ .withName(PublicIpAddressSkuName.BASIC)
+ .withTier(PublicIpAddressSkuTier.GLOBAL))
+ .withDeleteOption(DeleteOptions.DETACH)
+ .withPublicIpAllocationMethod(
+ PublicIpAllocationMethod.STATIC))))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmFromACustomImage.json
+ */
+ /**
+ * Sample code: Create a vm from a custom image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmFromACustomImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAVmWithHibernationEnabled.json
+ */
+ /**
+ * Sample code: Create a VM with HibernationEnabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMWithHibernationEnabled(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vm-name}",
+ new VirtualMachineInner()
+ .withLocation("eastus2euap")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2019-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("vmOSdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withAdditionalCapabilities(new AdditionalCapabilities().withHibernationEnabled(true))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("{vm-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithUefiSettings.json
+ */
+ /**
+ * Sample code: Create a VM with Uefi Settings of secureBoot and vTPM.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMWithUefiSettingsOfSecureBootAndVTPM(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("windowsserver-gen2preview-preview")
+ .withSku("windows10-tvm")
+ .withVersion("18363.592.2001092016"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_SSD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withSecurityProfile(
+ new SecurityProfile()
+ .withUefiSettings(new UefiSettings().withSecureBootEnabled(true).withVTpmEnabled(true))
+ .withSecurityType(SecurityTypes.TRUSTED_LAUNCH)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithApplicationProfile.json
+ */
+ /**
+ * Sample code: Create a vm with Application Profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithApplicationProfile(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("{image_publisher}")
+ .withOffer("{image_offer}")
+ .withSku("{image_sku}")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withApplicationProfile(
+ new ApplicationProfile()
+ .withGalleryApplications(
+ Arrays
+ .asList(
+ new VMGalleryApplication()
+ .withTags("myTag1")
+ .withOrder(1)
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0")
+ .withConfigurationReference(
+ "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"),
+ new VMGalleryApplication()
+ .withPackageReferenceId(
+ "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1")))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmFromASpecializedSharedImage.json
+ */
+ /**
+ * Sample code: Create a vm from a specialized shared image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmFromASpecializedSharedImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithPasswordAuthentication.json
+ */
+ /**
+ * Sample code: Create a vm with password authentication.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithPasswordAuthentication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain.json
+ */
+ /**
+ * Sample code: Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withVirtualMachineScaleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}"))
+ .withPlatformFaultDomain(1),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithScheduledEventsProfile.json
+ */
+ /**
+ * Sample code: Create a vm with Scheduled Events Profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithScheduledEventsProfile(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withScheduledEventsProfile(
+ new ScheduledEventsProfile()
+ .withTerminateNotificationProfile(
+ new TerminateNotificationProfile().withNotBeforeTimeout("PT10M").withEnable(true))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a vm with boot diagnostics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithBootDiagnostics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithSshAuthentication.json
+ */
+ /**
+ * Sample code: Create a vm with ssh authentication.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithSshAuthentication(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("{image_publisher}")
+ .withOffer("{image_offer}")
+ .withSku("{image_sku}")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withDisablePasswordAuthentication(true)
+ .withSsh(
+ new SshConfiguration()
+ .withPublicKeys(
+ Arrays
+ .asList(
+ new SshPublicKey()
+ .withPath("/home/{your-username}/.ssh/authorized_keys")
+ .withKeyData(
+ "ssh-rsa"
+ + " AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"))))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json
+ */
+ /**
+ * Sample code: Create a vm with ephemeral os disk provisioning in Resource disk using placement property.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withDiffDiskSettings(
+ new DiffDiskSettings()
+ .withOption(DiffDiskOptions.LOCAL)
+ .withPlacement(DiffDiskPlacement.RESOURCE_DISK))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithADiffOsDisk.json
+ */
+ /**
+ * Sample code: Create a vm with ephemeral os disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithEphemeralOsDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withPlan(
+ new Plan()
+ .withName("windows2016")
+ .withPublisher("microsoft-ads")
+ .withProduct("windows-data-science-vm"))
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_DS1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("microsoft-ads")
+ .withOffer("windows-data-science-vm")
+ .withSku("windows2016")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_ONLY)
+ .withDiffDiskSettings(new DiffDiskSettings().withOption(DiffDiskOptions.LOCAL))
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateOrUpdateAVmWithUserData.json
+ */
+ /**
+ * Sample code: Create a VM with UserData.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVMWithUserData(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "{vm-name}",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("vmOSdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("{vm-name}")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile()
+ .withBootDiagnostics(
+ new BootDiagnostics()
+ .withEnabled(true)
+ .withStorageUri("http://{existing-storage-account-name}.blob.core.windows.net")))
+ .withUserData("RXhhbXBsZSBVc2VyRGF0YQ=="),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmFromAGeneralizedSharedImage.json
+ */
+ /**
+ * Sample code: Create a vm from a generalized shared image.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmFromAGeneralizedSharedImage(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAWindowsVmWithPatchSettingModeOfManual.json
+ */
+ /**
+ * Sample code: Create a Windows vm with a patch setting patchMode of Manual.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAWindowsVmWithAPatchSettingPatchModeOfManual(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withWindowsConfiguration(
+ new WindowsConfiguration()
+ .withProvisionVMAgent(true)
+ .withEnableAutomaticUpdates(true)
+ .withPatchSettings(
+ new PatchSettings().withPatchMode(WindowsVMGuestPatchMode.MANUAL))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateALinuxVmWithPatchSettingModeOfImageDefault.json
+ */
+ /**
+ * Sample code: Create a Linux vm with a patch setting patchMode of ImageDefault.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createALinuxVmWithAPatchSettingPatchModeOfImageDefault(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2S_V3))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("Canonical")
+ .withOffer("UbuntuServer")
+ .withSku("16.04-LTS")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.PREMIUM_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}")
+ .withLinuxConfiguration(
+ new LinuxConfiguration()
+ .withProvisionVMAgent(true)
+ .withPatchSettings(
+ new LinuxPatchSettings().withPatchMode(LinuxVMGuestPatchMode.IMAGE_DEFAULT))))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithManagedBootDiagnostics.json
+ */
+ /**
+ * Sample code: Create a vm with managed boot diagnostics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithManagedBootDiagnostics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true))))
+ .withDiagnosticsProfile(
+ new DiagnosticsProfile().withBootDiagnostics(new BootDiagnostics().withEnabled(true))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/CreateAVmWithDiskEncryptionSetResource.json
+ */
+ /**
+ * Sample code: Create a vm with DiskEncryptionSet resource id in the os disk and data disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineInner()
+ .withLocation("westus")
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D1_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))),
+ new DataDisk()
+ .withLun(1)
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.ATTACH)
+ .withDiskSizeGB(1023)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}")
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)
+ .withDiskEncryptionSet(
+ new DiskEncryptionSetParameters()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"))))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesDeleteSamples.java
new file mode 100644
index 0000000000000..fda4b82ea99e9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Delete. */
+public final class VirtualMachinesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ForceDeleteVirtualMachine.json
+ */
+ /**
+ * Sample code: Force delete a VM.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void forceDeleteAVM(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .delete("myResourceGroup", "myVM", true, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesGeneralizeSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesGeneralizeSamples.java
new file mode 100644
index 0000000000000..9ece1e79bf564
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesGeneralizeSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Generalize. */
+public final class VirtualMachinesGeneralizeSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GeneralizeVirtualMachine.json
+ */
+ /**
+ * Sample code: Generalize a Virtual Machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void generalizeAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .generalizeWithResponse("myResourceGroup", "myVMName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..bcebfa8920768
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesGetByResourceGroupSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines GetByResourceGroup. */
+public final class VirtualMachinesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get a virtual machine placed on a dedicated host group through automatic placement.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachine.json
+ */
+ /**
+ * Sample code: Get a Virtual Machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .getByResourceGroupWithResponse("myResourceGroup", "myVM", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesInstallPatchesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesInstallPatchesSamples.java
new file mode 100644
index 0000000000000..a70c3d84d1b3d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesInstallPatchesSamples.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.VMGuestPatchClassificationWindows;
+import com.azure.resourcemanager.compute.models.VMGuestPatchRebootSetting;
+import com.azure.resourcemanager.compute.models.VirtualMachineInstallPatchesParameters;
+import com.azure.resourcemanager.compute.models.WindowsParameters;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for VirtualMachines InstallPatches. */
+public final class VirtualMachinesInstallPatchesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/VirtualMachineInstallPatches.json
+ */
+ /**
+ * Sample code: Install patch state of a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void installPatchStateOfAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .installPatches(
+ "myResourceGroupName",
+ "myVMName",
+ new VirtualMachineInstallPatchesParameters()
+ .withMaximumDuration("PT4H")
+ .withRebootSetting(VMGuestPatchRebootSetting.IF_REQUIRED)
+ .withWindowsParameters(
+ new WindowsParameters()
+ .withClassificationsToInclude(
+ Arrays
+ .asList(
+ VMGuestPatchClassificationWindows.CRITICAL,
+ VMGuestPatchClassificationWindows.SECURITY))
+ .withMaxPatchPublishDate(OffsetDateTime.parse("2020-11-19T02:36:43.0539904+00:00"))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesInstanceViewSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesInstanceViewSamples.java
new file mode 100644
index 0000000000000..c2af0ec9266b3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesInstanceViewSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines InstanceView. */
+public final class VirtualMachinesInstanceViewSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineInstanceView.json
+ */
+ /**
+ * Sample code: Get Virtual Machine Instance View.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getVirtualMachineInstanceView(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .instanceViewWithResponse("myResourceGroup", "myVM", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/GetVirtualMachineInstanceViewAutoPlacedOnDedicatedHostGroup.json
+ */
+ /**
+ * Sample code: Get instance view of a virtual machine placed on a dedicated host group through automatic placement.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .instanceViewWithResponse("myResourceGroup", "myVM", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesListAvailableSizesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesListAvailableSizesSamples.java
new file mode 100644
index 0000000000000..447fa59145610
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesListAvailableSizesSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines ListAvailableSizes. */
+public final class VirtualMachinesListAvailableSizesSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListAvailableVmSizes_VirtualMachines.json
+ */
+ /**
+ * Sample code: Lists all available virtual machine sizes to which the specified virtual machine can be resized.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .listAvailableSizes("myResourceGroup", "myVmName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesListByLocationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesListByLocationSamples.java
new file mode 100644
index 0000000000000..f9b0153b97004
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesListByLocationSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines ListByLocation. */
+public final class VirtualMachinesListByLocationSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListVirtualMachinesInASubscriptionByLocation.json
+ */
+ /**
+ * Sample code: Lists all the virtual machines under the specified subscription for the specified location.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.virtualMachines().manager().serviceClient().getVirtualMachines().listByLocation("eastus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesReapplySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesReapplySamples.java
new file mode 100644
index 0000000000000..7459e14a6f3ea
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesReapplySamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines Reapply. */
+public final class VirtualMachinesReapplySamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ReapplyVirtualMachine.json
+ */
+ /**
+ * Sample code: Reapply the state of a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void reapplyTheStateOfAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .reapply("ResourceGroup", "VMName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesReimageSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesReimageSamples.java
new file mode 100644
index 0000000000000..51e561a279baf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesReimageSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.VirtualMachineReimageParameters;
+
+/** Samples for VirtualMachines Reimage. */
+public final class VirtualMachinesReimageSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ReimageVirtualMachine.json
+ */
+ /**
+ * Sample code: Reimage a Virtual Machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void reimageAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .reimage(
+ "myResourceGroup", "myVMName", new VirtualMachineReimageParameters().withTempDisk(true), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java
new file mode 100644
index 0000000000000..2170b779428b4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesRetrieveBootDiagnosticsDataSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines RetrieveBootDiagnosticsData. */
+public final class VirtualMachinesRetrieveBootDiagnosticsDataSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/RetrieveBootDiagnosticsDataVirtualMachine.json
+ */
+ /**
+ * Sample code: RetrieveBootDiagnosticsData of a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void retrieveBootDiagnosticsDataOfAVirtualMachine(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .retrieveBootDiagnosticsDataWithResponse("ResourceGroup", "VMName", 60, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesRunCommandSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesRunCommandSamples.java
new file mode 100644
index 0000000000000..90283b7803011
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesRunCommandSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.models.RunCommandInput;
+
+/** Samples for VirtualMachines RunCommand. */
+public final class VirtualMachinesRunCommandSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/runCommands/VirtualMachineRunCommand.json
+ */
+ /**
+ * Sample code: VirtualMachineRunCommand.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void virtualMachineRunCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .runCommand(
+ "crptestar98131", "vm3036", new RunCommandInput().withCommandId("RunPowerShellScript"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesSimulateEvictionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesSimulateEvictionSamples.java
new file mode 100644
index 0000000000000..6b17c95007e86
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesSimulateEvictionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for VirtualMachines SimulateEviction. */
+public final class VirtualMachinesSimulateEvictionSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/SimulateEvictionOfVM.json
+ */
+ /**
+ * Sample code: Simulate Eviction a virtual machine.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void simulateEvictionAVirtualMachine(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .simulateEvictionWithResponse("ResourceGroup", "VMName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesUpdateSamples.java
new file mode 100644
index 0000000000000..eae748cbb526a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/compute/generated/VirtualMachinesUpdateSamples.java
@@ -0,0 +1,157 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.compute.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.compute.fluent.models.VirtualMachineUpdateInner;
+import com.azure.resourcemanager.compute.models.CachingTypes;
+import com.azure.resourcemanager.compute.models.DataDisk;
+import com.azure.resourcemanager.compute.models.DiskCreateOptionTypes;
+import com.azure.resourcemanager.compute.models.DiskDetachOptionTypes;
+import com.azure.resourcemanager.compute.models.HardwareProfile;
+import com.azure.resourcemanager.compute.models.ImageReference;
+import com.azure.resourcemanager.compute.models.ManagedDiskParameters;
+import com.azure.resourcemanager.compute.models.NetworkInterfaceReference;
+import com.azure.resourcemanager.compute.models.NetworkProfile;
+import com.azure.resourcemanager.compute.models.OSDisk;
+import com.azure.resourcemanager.compute.models.OSProfile;
+import com.azure.resourcemanager.compute.models.StorageAccountTypes;
+import com.azure.resourcemanager.compute.models.StorageProfile;
+import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes;
+import java.util.Arrays;
+
+/** Samples for VirtualMachines Update. */
+public final class VirtualMachinesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/UpdateVMDetachDataDiskUsingToBeDetachedProperty.json
+ */
+ /**
+ * Sample code: Update a VM by detaching data disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAVMByDetachingDataDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .update(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineUpdateInner()
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(true),
+ new DataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(false))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/UpdateVMForceDetachDataDisk.json
+ */
+ /**
+ * Sample code: Update a VM by force-detaching data disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAVMByForceDetachingDataDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .virtualMachines()
+ .manager()
+ .serviceClient()
+ .getVirtualMachines()
+ .update(
+ "myResourceGroup",
+ "myVM",
+ new VirtualMachineUpdateInner()
+ .withHardwareProfile(new HardwareProfile().withVmSize(VirtualMachineSizeTypes.STANDARD_D2_V2))
+ .withStorageProfile(
+ new StorageProfile()
+ .withImageReference(
+ new ImageReference()
+ .withPublisher("MicrosoftWindowsServer")
+ .withOffer("WindowsServer")
+ .withSku("2016-Datacenter")
+ .withVersion("latest"))
+ .withOsDisk(
+ new OSDisk()
+ .withName("myVMosdisk")
+ .withCaching(CachingTypes.READ_WRITE)
+ .withCreateOption(DiskCreateOptionTypes.FROM_IMAGE)
+ .withManagedDisk(
+ new ManagedDiskParameters()
+ .withStorageAccountType(StorageAccountTypes.STANDARD_LRS)))
+ .withDataDisks(
+ Arrays
+ .asList(
+ new DataDisk()
+ .withLun(0)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(true)
+ .withDetachOption(DiskDetachOptionTypes.FORCE_DETACH),
+ new DataDisk()
+ .withLun(1)
+ .withCreateOption(DiskCreateOptionTypes.EMPTY)
+ .withDiskSizeGB(1023)
+ .withToBeDetached(false))))
+ .withOsProfile(
+ new OSProfile()
+ .withComputerName("myVM")
+ .withAdminUsername("{your-username}")
+ .withAdminPassword("{your-password}"))
+ .withNetworkProfile(
+ new NetworkProfile()
+ .withNetworkInterfaces(
+ Arrays
+ .asList(
+ new NetworkInterfaceReference()
+ .withId(
+ "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
+ .withPrimary(true)))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsCreateSamples.java
new file mode 100644
index 0000000000000..c7e34fd209506
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsCreateSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.AgentPoolInner;
+import com.azure.resourcemanager.containerregistry.models.OS;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AgentPools Create. */
+public final class AgentPoolsCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json
+ */
+ /**
+ * Sample code: AgentPools_Create.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void agentPoolsCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myAgentPool",
+ new AgentPoolInner()
+ .withLocation("WESTUS")
+ .withTags(mapOf("key", "value"))
+ .withCount(1)
+ .withTier("S1")
+ .withOs(OS.LINUX),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsDeleteSamples.java
new file mode 100644
index 0000000000000..d081c05e19c65
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools Delete. */
+public final class AgentPoolsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json
+ */
+ /**
+ * Sample code: AgentPools_Delete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void agentPoolsDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .delete("myResourceGroup", "myRegistry", "myAgentPool", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetQueueStatusSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetQueueStatusSamples.java
new file mode 100644
index 0000000000000..ac09950999df9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetQueueStatusSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools GetQueueStatus. */
+public final class AgentPoolsGetQueueStatusSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json
+ */
+ /**
+ * Sample code: AgentPools_GetQueueStatus.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void agentPoolsGetQueueStatus(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .getQueueStatusWithResponse("myResourceGroup", "myRegistry", "myAgentPool", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetSamples.java
new file mode 100644
index 0000000000000..92f5022dc1c4d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools Get. */
+public final class AgentPoolsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json
+ */
+ /**
+ * Sample code: AgentPools_Get.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void agentPoolsGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .getWithResponse("myResourceGroup", "myRegistry", "myAgentPool", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsListSamples.java
new file mode 100644
index 0000000000000..b0ac9a476a4e2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools List. */
+public final class AgentPoolsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json
+ */
+ /**
+ * Sample code: AgentPools_List.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void agentPoolsList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsUpdateSamples.java
new file mode 100644
index 0000000000000..bc7d612663ead
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsUpdateSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.AgentPoolUpdateParameters;
+
+/** Samples for AgentPools Update. */
+public final class AgentPoolsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json
+ */
+ /**
+ * Sample code: AgentPools_Update.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void agentPoolsUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myAgentPool",
+ new AgentPoolUpdateParameters().withCount(1),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesCreateSamples.java
new file mode 100644
index 0000000000000..3861f41c28be9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesCreateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.ExportPipelineInner;
+import com.azure.resourcemanager.containerregistry.models.ExportPipelineTargetProperties;
+import com.azure.resourcemanager.containerregistry.models.IdentityProperties;
+import com.azure.resourcemanager.containerregistry.models.PipelineOptions;
+import com.azure.resourcemanager.containerregistry.models.ResourceIdentityType;
+import java.util.Arrays;
+
+/** Samples for ExportPipelines Create. */
+public final class ExportPipelinesCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ExportPipelineCreate.json
+ */
+ /**
+ * Sample code: ExportPipelineCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void exportPipelineCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getExportPipelines()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myExportPipeline",
+ new ExportPipelineInner()
+ .withLocation("westus")
+ .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
+ .withTarget(
+ new ExportPipelineTargetProperties()
+ .withType("AzureStorageBlobContainer")
+ .withUri("https://accountname.blob.core.windows.net/containername")
+ .withKeyVaultUri("https://myvault.vault.azure.net/secrets/acrexportsas"))
+ .withOptions(Arrays.asList(PipelineOptions.OVERWRITE_BLOBS)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesDeleteSamples.java
new file mode 100644
index 0000000000000..20d2760caaae3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExportPipelines Delete. */
+public final class ExportPipelinesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ExportPipelineDelete.json
+ */
+ /**
+ * Sample code: ExportPipelineDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void exportPipelineDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getExportPipelines()
+ .delete("myResourceGroup", "myRegistry", "myExportPipeline", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesGetSamples.java
new file mode 100644
index 0000000000000..86d6e376697db
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExportPipelines Get. */
+public final class ExportPipelinesGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ExportPipelineGet.json
+ */
+ /**
+ * Sample code: ExportPipelineGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void exportPipelineGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getExportPipelines()
+ .getWithResponse("myResourceGroup", "myRegistry", "myExportPipeline", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesListSamples.java
new file mode 100644
index 0000000000000..6c46b8b18f903
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ExportPipelinesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExportPipelines List. */
+public final class ExportPipelinesListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ExportPipelineList.json
+ */
+ /**
+ * Sample code: ExportPipelineList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void exportPipelineList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getExportPipelines()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesCreateSamples.java
new file mode 100644
index 0000000000000..8e66efdc64b32
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesCreateSamples.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.ImportPipelineInner;
+import com.azure.resourcemanager.containerregistry.models.IdentityProperties;
+import com.azure.resourcemanager.containerregistry.models.ImportPipelineSourceProperties;
+import com.azure.resourcemanager.containerregistry.models.PipelineOptions;
+import com.azure.resourcemanager.containerregistry.models.PipelineSourceType;
+import com.azure.resourcemanager.containerregistry.models.ResourceIdentityType;
+import com.azure.resourcemanager.containerregistry.models.UserIdentityProperties;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ImportPipelines Create. */
+public final class ImportPipelinesCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportPipelineCreate.json
+ */
+ /**
+ * Sample code: ImportPipelineCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importPipelineCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getImportPipelines()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myImportPipeline",
+ new ImportPipelineInner()
+ .withLocation("westus")
+ .withIdentity(
+ new IdentityProperties()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2",
+ new UserIdentityProperties())))
+ .withSource(
+ new ImportPipelineSourceProperties()
+ .withType(PipelineSourceType.AZURE_STORAGE_BLOB_CONTAINER)
+ .withUri("https://accountname.blob.core.windows.net/containername")
+ .withKeyVaultUri("https://myvault.vault.azure.net/secrets/acrimportsas"))
+ .withOptions(
+ Arrays
+ .asList(
+ PipelineOptions.OVERWRITE_TAGS,
+ PipelineOptions.DELETE_SOURCE_BLOB_ON_SUCCESS,
+ PipelineOptions.CONTINUE_ON_ERRORS)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesDeleteSamples.java
new file mode 100644
index 0000000000000..9b884495d051d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ImportPipelines Delete. */
+public final class ImportPipelinesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportPipelineDelete.json
+ */
+ /**
+ * Sample code: ImportPipelineDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importPipelineDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getImportPipelines()
+ .delete("myResourceGroup", "myRegistry", "myImportPipeline", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesGetSamples.java
new file mode 100644
index 0000000000000..a0e10ff0fe0d0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ImportPipelines Get. */
+public final class ImportPipelinesGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportPipelineGet.json
+ */
+ /**
+ * Sample code: ImportPipelineGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importPipelineGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getImportPipelines()
+ .getWithResponse("myResourceGroup", "myRegistry", "myImportPipeline", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesListSamples.java
new file mode 100644
index 0000000000000..f2342e6b94a55
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ImportPipelinesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ImportPipelines List. */
+public final class ImportPipelinesListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportPipelineList.json
+ */
+ /**
+ * Sample code: ImportPipelineList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importPipelineList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getImportPipelines()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/OperationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/OperationsListSamples.java
new file mode 100644
index 0000000000000..56eaa81ee6ce4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/OperationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/OperationList.json
+ */
+ /**
+ * Sample code: OperationList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void operationList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.containerRegistries().manager().serviceClient().getOperations().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsCreateSamples.java
new file mode 100644
index 0000000000000..2279356bcfd1b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsCreateSamples.java
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.PipelineRunInner;
+import com.azure.resourcemanager.containerregistry.models.PipelineRunRequest;
+import com.azure.resourcemanager.containerregistry.models.PipelineRunSourceProperties;
+import com.azure.resourcemanager.containerregistry.models.PipelineRunSourceType;
+import com.azure.resourcemanager.containerregistry.models.PipelineRunTargetProperties;
+import com.azure.resourcemanager.containerregistry.models.PipelineRunTargetType;
+import java.util.Arrays;
+
+/** Samples for PipelineRuns Create. */
+public final class PipelineRunsCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PipelineRunCreate_Import.json
+ */
+ /**
+ * Sample code: PipelineRunCreate_Import.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void pipelineRunCreateImport(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPipelineRuns()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myPipelineRun",
+ new PipelineRunInner()
+ .withRequest(
+ new PipelineRunRequest()
+ .withPipelineResourceId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline")
+ .withSource(
+ new PipelineRunSourceProperties()
+ .withType(PipelineRunSourceType.AZURE_STORAGE_BLOB)
+ .withName("myblob.tar.gz"))
+ .withCatalogDigest("sha256@"))
+ .withForceUpdateTag("2020-03-04T17:23:21.9261521+00:00"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PipelineRunCreate_Export.json
+ */
+ /**
+ * Sample code: PipelineRunCreate_Export.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void pipelineRunCreateExport(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPipelineRuns()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myPipelineRun",
+ new PipelineRunInner()
+ .withRequest(
+ new PipelineRunRequest()
+ .withPipelineResourceId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline")
+ .withArtifacts(
+ Arrays
+ .asList(
+ "sourceRepository/hello-world",
+ "sourceRepository2@sha256:00000000000000000000000000000000000"))
+ .withTarget(
+ new PipelineRunTargetProperties()
+ .withType(PipelineRunTargetType.AZURE_STORAGE_BLOB)
+ .withName("myblob.tar.gz"))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsDeleteSamples.java
new file mode 100644
index 0000000000000..eb919a07a120c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PipelineRuns Delete. */
+public final class PipelineRunsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PipelineRunDelete.json
+ */
+ /**
+ * Sample code: PipelineRunDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void pipelineRunDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPipelineRuns()
+ .delete("myResourceGroup", "myRegistry", "myPipelineRun", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsGetSamples.java
new file mode 100644
index 0000000000000..5b4ba70716b58
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PipelineRuns Get. */
+public final class PipelineRunsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PipelineRunGet.json
+ */
+ /**
+ * Sample code: PipelineRunGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void pipelineRunGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPipelineRuns()
+ .getWithResponse("myResourceGroup", "myRegistry", "myPipelineRun", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsListSamples.java
new file mode 100644
index 0000000000000..d2fece920436b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PipelineRunsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PipelineRuns List. */
+public final class PipelineRunsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PipelineRunList.json
+ */
+ /**
+ * Sample code: PipelineRunList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void pipelineRunList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPipelineRuns()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5e78da58305f8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.containerregistry.models.ConnectionStatus;
+import com.azure.resourcemanager.containerregistry.models.PrivateLinkServiceConnectionState;
+
+/** Samples for PrivateEndpointConnections CreateOrUpdate. */
+public final class PrivateEndpointConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json
+ */
+ /**
+ * Sample code: PrivateEndpointConnectionCreateOrUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void privateEndpointConnectionCreateOrUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .createOrUpdate(
+ "myResourceGroup",
+ "myRegistry",
+ "myConnection",
+ new PrivateEndpointConnectionInner()
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState()
+ .withStatus(ConnectionStatus.APPROVED)
+ .withDescription("Auto-Approved")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..55749026b063b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Delete. */
+public final class PrivateEndpointConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PrivateEndpointConnectionDelete.json
+ */
+ /**
+ * Sample code: PrivateEndpointConnectionDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void privateEndpointConnectionDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .delete("myResourceGroup", "myRegistry", "myConnection", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsGetSamples.java
new file mode 100644
index 0000000000000..4378182af1778
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Get. */
+public final class PrivateEndpointConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PrivateEndpointConnectionGet.json
+ */
+ /**
+ * Sample code: PrivateEndpointConnectionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void privateEndpointConnectionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse("myResourceGroup", "myRegistry", "myConnection", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsListSamples.java
new file mode 100644
index 0000000000000..18dde00acae22
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/PrivateEndpointConnectionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections List. */
+public final class PrivateEndpointConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/PrivateEndpointConnectionList.json
+ */
+ /**
+ * Sample code: PrivateEndpointConnectionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void privateEndpointConnectionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesCheckNameAvailabilitySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesCheckNameAvailabilitySamples.java
new file mode 100644
index 0000000000000..21cf6dece40e0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesCheckNameAvailabilitySamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.RegistryNameCheckRequest;
+
+/** Samples for Registries CheckNameAvailability. */
+public final class RegistriesCheckNameAvailabilitySamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryCheckNameAvailable.json
+ */
+ /**
+ * Sample code: RegistryCheckNameAvailable.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryCheckNameAvailable(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .checkNameAvailabilityWithResponse(new RegistryNameCheckRequest().withName("myRegistry"), Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryCheckNameNotAvailable.json
+ */
+ /**
+ * Sample code: RegistryCheckNameNotAvailable.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryCheckNameNotAvailable(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .checkNameAvailabilityWithResponse(new RegistryNameCheckRequest().withName("myRegistry"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesCreateSamples.java
new file mode 100644
index 0000000000000..4b049902149e4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesCreateSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.RegistryInner;
+import com.azure.resourcemanager.containerregistry.models.Sku;
+import com.azure.resourcemanager.containerregistry.models.SkuName;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Registries Create. */
+public final class RegistriesCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryCreate.json
+ */
+ /**
+ * Sample code: RegistryCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ new RegistryInner()
+ .withLocation("westus")
+ .withTags(mapOf("key", "value"))
+ .withSku(new Sku().withName(SkuName.STANDARD))
+ .withAdminUserEnabled(true),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesDeleteSamples.java
new file mode 100644
index 0000000000000..f2429798f973d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries Delete. */
+public final class RegistriesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryDelete.json
+ */
+ /**
+ * Sample code: RegistryDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .delete("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGenerateCredentialsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGenerateCredentialsSamples.java
new file mode 100644
index 0000000000000..5e455ea5d2c88
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGenerateCredentialsSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.GenerateCredentialsParameters;
+import java.time.OffsetDateTime;
+
+/** Samples for Registries GenerateCredentials. */
+public final class RegistriesGenerateCredentialsSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/RegistryGenerateCredentials.json
+ */
+ /**
+ * Sample code: RegistryGenerateCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryGenerateCredentials(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .generateCredentials(
+ "myResourceGroup",
+ "myRegistry",
+ new GenerateCredentialsParameters()
+ .withTokenId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken")
+ .withExpiry(OffsetDateTime.parse("2020-12-31T15:59:59.0707808Z")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetBuildSourceUploadUrlSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetBuildSourceUploadUrlSamples.java
new file mode 100644
index 0000000000000..cdc946611dc83
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetBuildSourceUploadUrlSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries GetBuildSourceUploadUrl. */
+public final class RegistriesGetBuildSourceUploadUrlSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json
+ */
+ /**
+ * Sample code: Registries_GetBuildSourceUploadUrl.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesGetBuildSourceUploadUrl(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .getBuildSourceUploadUrlWithResponse("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..b1ee75caa9e22
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries GetByResourceGroup. */
+public final class RegistriesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryGet.json
+ */
+ /**
+ * Sample code: RegistryGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesImportImageSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesImportImageSamples.java
new file mode 100644
index 0000000000000..22aa762ecedb8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesImportImageSamples.java
@@ -0,0 +1,101 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.ImportImageParameters;
+import com.azure.resourcemanager.containerregistry.models.ImportMode;
+import com.azure.resourcemanager.containerregistry.models.ImportSource;
+import java.util.Arrays;
+
+/** Samples for Registries ImportImage. */
+public final class RegistriesImportImageSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportImageFromPublicRegistry.json
+ */
+ /**
+ * Sample code: ImportImageFromPublicRegistry.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importImageFromPublicRegistry(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .importImage(
+ "myResourceGroup",
+ "myRegistry",
+ new ImportImageParameters()
+ .withSource(
+ new ImportSource()
+ .withRegistryUri("registry.hub.docker.com")
+ .withSourceImage("library/hello-world"))
+ .withTargetTags(Arrays.asList("targetRepository:targetTag"))
+ .withUntaggedTargetRepositories(Arrays.asList("targetRepository1"))
+ .withMode(ImportMode.FORCE),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportImageByTag.json
+ */
+ /**
+ * Sample code: ImportImageByTag.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importImageByTag(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .importImage(
+ "myResourceGroup",
+ "myRegistry",
+ new ImportImageParameters()
+ .withSource(
+ new ImportSource()
+ .withResourceId(
+ "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry")
+ .withSourceImage("sourceRepository:sourceTag"))
+ .withTargetTags(Arrays.asList("targetRepository:targetTag"))
+ .withUntaggedTargetRepositories(Arrays.asList("targetRepository1"))
+ .withMode(ImportMode.FORCE),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ImportImageByManifestDigest.json
+ */
+ /**
+ * Sample code: ImportImageByManifestDigest.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void importImageByManifestDigest(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .importImage(
+ "myResourceGroup",
+ "myRegistry",
+ new ImportImageParameters()
+ .withSource(
+ new ImportSource()
+ .withResourceId(
+ "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry")
+ .withSourceImage(
+ "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000"))
+ .withTargetTags(Arrays.asList("targetRepository:targetTag"))
+ .withUntaggedTargetRepositories(Arrays.asList("targetRepository1"))
+ .withMode(ImportMode.FORCE),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..b64d5eef444a6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries ListByResourceGroup. */
+public final class RegistriesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryListByResourceGroup.json
+ */
+ /**
+ * Sample code: RegistryListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryListByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListCredentialsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListCredentialsSamples.java
new file mode 100644
index 0000000000000..897ca47c5e96f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListCredentialsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries ListCredentials. */
+public final class RegistriesListCredentialsSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryListCredentials.json
+ */
+ /**
+ * Sample code: RegistryListCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryListCredentials(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .listCredentialsWithResponse("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListPrivateLinkResourcesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListPrivateLinkResourcesSamples.java
new file mode 100644
index 0000000000000..ab12ddda3af17
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListPrivateLinkResourcesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries ListPrivateLinkResources. */
+public final class RegistriesListPrivateLinkResourcesSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryListPrivateLinkResources.json
+ */
+ /**
+ * Sample code: RegistryListPrivateLinkResources.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryListPrivateLinkResources(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .listPrivateLinkResources("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListSamples.java
new file mode 100644
index 0000000000000..e27fd7b3fb86b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries List. */
+public final class RegistriesListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryList.json
+ */
+ /**
+ * Sample code: RegistryList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.containerRegistries().manager().serviceClient().getRegistries().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListUsagesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListUsagesSamples.java
new file mode 100644
index 0000000000000..71a5b7d32ac36
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesListUsagesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Registries ListUsages. */
+public final class RegistriesListUsagesSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryListUsages.json
+ */
+ /**
+ * Sample code: RegistryListUsages.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryListUsages(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .listUsagesWithResponse("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesRegenerateCredentialSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesRegenerateCredentialSamples.java
new file mode 100644
index 0000000000000..17325b6abae28
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesRegenerateCredentialSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.PasswordName;
+import com.azure.resourcemanager.containerregistry.models.RegenerateCredentialParameters;
+
+/** Samples for Registries RegenerateCredential. */
+public final class RegistriesRegenerateCredentialSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryRegenerateCredential.json
+ */
+ /**
+ * Sample code: RegistryRegenerateCredential.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryRegenerateCredential(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .regenerateCredentialWithResponse(
+ "myResourceGroup",
+ "myRegistry",
+ new RegenerateCredentialParameters().withName(PasswordName.PASSWORD),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesScheduleRunSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesScheduleRunSamples.java
new file mode 100644
index 0000000000000..3f68567320748
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesScheduleRunSamples.java
@@ -0,0 +1,338 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.AgentProperties;
+import com.azure.resourcemanager.containerregistry.models.Architecture;
+import com.azure.resourcemanager.containerregistry.models.Argument;
+import com.azure.resourcemanager.containerregistry.models.Credentials;
+import com.azure.resourcemanager.containerregistry.models.CustomRegistryCredentials;
+import com.azure.resourcemanager.containerregistry.models.DockerBuildRequest;
+import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest;
+import com.azure.resourcemanager.containerregistry.models.FileTaskRunRequest;
+import com.azure.resourcemanager.containerregistry.models.OS;
+import com.azure.resourcemanager.containerregistry.models.OverrideTaskStepProperties;
+import com.azure.resourcemanager.containerregistry.models.PlatformProperties;
+import com.azure.resourcemanager.containerregistry.models.SecretObject;
+import com.azure.resourcemanager.containerregistry.models.SecretObjectType;
+import com.azure.resourcemanager.containerregistry.models.SetValue;
+import com.azure.resourcemanager.containerregistry.models.SourceRegistryCredentials;
+import com.azure.resourcemanager.containerregistry.models.SourceRegistryLoginMode;
+import com.azure.resourcemanager.containerregistry.models.TaskRunRequest;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Registries ScheduleRun. */
+public final class RegistriesScheduleRunSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun_FileTaskRun.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRunFileTaskRun(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new FileTaskRunRequest()
+ .withTaskFilePath("acb.yaml")
+ .withValuesFilePath("prod-values.yaml")
+ .withValues(
+ Arrays
+ .asList(
+ new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false),
+ new SetValue()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withSourceLocation(
+ "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRun(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new DockerBuildRequest()
+ .withIsArchiveEnabled(true)
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(true)
+ .withDockerFilePath("DockerFile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withSourceLocation(
+ "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun_EncodedTaskRun.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRunEncodedTaskRun(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new EncodedTaskRunRequest()
+ .withEncodedTaskContent(
+ "c3RlcHM6Cnt7IGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAncHJvZCcgfX0KICAtIHJ1bjogcHJvZCBzZXR1cAp7eyBlbHNlIGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAnc3RhZ2luZycgfX0KICAtIHJ1bjogc3RhZ2luZyBzZXR1cAp7eyBlbHNlIH19CiAgLSBydW46IGRlZmF1bHQgc2V0dXAKe3sgZW5kIH19CgogIC0gcnVuOiBidWlsZCAtdCBGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0gLgoKcHVzaDogWydGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0nXQ==")
+ .withEncodedValuesContent("ZW52aXJvbm1lbnQ6IHByb2QKdmVyc2lvbjogMQ==")
+ .withValues(
+ Arrays
+ .asList(
+ new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false),
+ new SetValue()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX))
+ .withAgentConfiguration(new AgentProperties().withCpu(2)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun_WithCustomCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRunWithCustomCredentials(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new DockerBuildRequest()
+ .withIsArchiveEnabled(true)
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(true)
+ .withDockerFilePath("DockerFile")
+ .withTarget("stage1")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withSourceLocation(
+ "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D")
+ .withCredentials(
+ new Credentials()
+ .withSourceRegistry(
+ new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT))
+ .withCustomRegistries(
+ mapOf(
+ "myregistry.azurecr.io",
+ new CustomRegistryCredentials()
+ .withUsername(
+ new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE))
+ .withPassword(
+ new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE)),
+ "myregistry2.azurecr.io",
+ new CustomRegistryCredentials()
+ .withUsername(
+ new SecretObject().withValue("reg2").withType(SecretObjectType.OPAQUE))
+ .withPassword(
+ new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun_WithLogTemplate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRunWithLogTemplate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new DockerBuildRequest()
+ .withIsArchiveEnabled(true)
+ .withLogTemplate("acr/tasks:{{.Run.OS}}")
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(true)
+ .withDockerFilePath("DockerFile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withSourceLocation(
+ "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun_Task.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRunTask(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new TaskRunRequest()
+ .withTaskId("myTask")
+ .withOverrideTaskStepProperties(
+ new OverrideTaskStepProperties()
+ .withFile("overriddenDockerfile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument()
+ .withName("mytestargument")
+ .withValue("mytestvalue")
+ .withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withTarget("build")
+ .withValues(
+ Arrays
+ .asList(
+ new SetValue()
+ .withName("mytestname")
+ .withValue("mytestvalue")
+ .withIsSecret(false),
+ new SetValue()
+ .withName("mysecrettestname")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withUpdateTriggerToken("aGVsbG8gd29ybGQ=")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json
+ */
+ /**
+ * Sample code: Registries_ScheduleRun_Task_WithCustomCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registriesScheduleRunTaskWithCustomCredentials(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .scheduleRun(
+ "myResourceGroup",
+ "myRegistry",
+ new FileTaskRunRequest()
+ .withTaskFilePath("acb.yaml")
+ .withValues(
+ Arrays
+ .asList(
+ new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false),
+ new SetValue()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true)))
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX))
+ .withCredentials(
+ new Credentials()
+ .withSourceRegistry(
+ new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT))
+ .withCustomRegistries(
+ mapOf(
+ "myregistry.azurecr.io",
+ new CustomRegistryCredentials()
+ .withUsername(
+ new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE))
+ .withPassword(
+ new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesUpdateSamples.java
new file mode 100644
index 0000000000000..f56b99611fd82
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesUpdateSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.RegistryUpdateParameters;
+import com.azure.resourcemanager.containerregistry.models.Sku;
+import com.azure.resourcemanager.containerregistry.models.SkuName;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Registries Update. */
+public final class RegistriesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/RegistryUpdate.json
+ */
+ /**
+ * Sample code: RegistryUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void registryUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRegistries()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ new RegistryUpdateParameters()
+ .withTags(mapOf("key", "value"))
+ .withSku(new Sku().withName(SkuName.STANDARD))
+ .withAdminUserEnabled(true),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsCreateSamples.java
new file mode 100644
index 0000000000000..2a9e4e7c5394f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsCreateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.ReplicationInner;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Replications Create. */
+public final class ReplicationsCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ReplicationCreate.json
+ */
+ /**
+ * Sample code: ReplicationCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void replicationCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getReplications()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myReplication",
+ new ReplicationInner().withLocation("eastus").withTags(mapOf("key", "value")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsDeleteSamples.java
new file mode 100644
index 0000000000000..87ef02b534bb9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Replications Delete. */
+public final class ReplicationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ReplicationDelete.json
+ */
+ /**
+ * Sample code: ReplicationDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void replicationDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getReplications()
+ .delete("myResourceGroup", "myRegistry", "myReplication", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsGetSamples.java
new file mode 100644
index 0000000000000..493fbb234126c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Replications Get. */
+public final class ReplicationsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ReplicationGet.json
+ */
+ /**
+ * Sample code: ReplicationGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void replicationGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getReplications()
+ .getWithResponse("myResourceGroup", "myRegistry", "myReplication", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsListSamples.java
new file mode 100644
index 0000000000000..d37621c2a9306
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Replications List. */
+public final class ReplicationsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ReplicationList.json
+ */
+ /**
+ * Sample code: ReplicationList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void replicationList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getReplications()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsUpdateSamples.java
new file mode 100644
index 0000000000000..3110081244930
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ReplicationsUpdateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.ReplicationUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Replications Update. */
+public final class ReplicationsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/ReplicationUpdate.json
+ */
+ /**
+ * Sample code: ReplicationUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void replicationUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getReplications()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myReplication",
+ new ReplicationUpdateParameters().withTags(mapOf("key", "value")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsCancelSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsCancelSamples.java
new file mode 100644
index 0000000000000..f09051b4f03f9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsCancelSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Runs Cancel. */
+public final class RunsCancelSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json
+ */
+ /**
+ * Sample code: Runs_Cancel.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void runsCancel(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRuns()
+ .cancel("myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetLogSasUrlSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetLogSasUrlSamples.java
new file mode 100644
index 0000000000000..59e5050171b68
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetLogSasUrlSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Runs GetLogSasUrl. */
+public final class RunsGetLogSasUrlSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json
+ */
+ /**
+ * Sample code: Runs_GetLogSasUrl.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void runsGetLogSasUrl(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRuns()
+ .getLogSasUrlWithResponse(
+ "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetSamples.java
new file mode 100644
index 0000000000000..abd86d084f9c8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Runs Get. */
+public final class RunsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json
+ */
+ /**
+ * Sample code: Runs_Get.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void runsGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRuns()
+ .getWithResponse("myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsListSamples.java
new file mode 100644
index 0000000000000..69d05479a036c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Runs List. */
+public final class RunsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json
+ */
+ /**
+ * Sample code: Runs_List.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void runsList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRuns()
+ .list("myResourceGroup", "myRegistry", "", 10, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsUpdateSamples.java
new file mode 100644
index 0000000000000..b4729fcfc04d3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsUpdateSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.RunUpdateParameters;
+
+/** Samples for Runs Update. */
+public final class RunsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json
+ */
+ /**
+ * Sample code: Runs_Update.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void runsUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getRuns()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "0accec26-d6de-4757-8e74-d080f38eaaab",
+ new RunUpdateParameters().withIsArchiveEnabled(true),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsCreateSamples.java
new file mode 100644
index 0000000000000..e99af59823482
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsCreateSamples.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.ScopeMapInner;
+import java.util.Arrays;
+
+/** Samples for ScopeMaps Create. */
+public final class ScopeMapsCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/ScopeMapCreate.json
+ */
+ /**
+ * Sample code: ScopeMapCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void scopeMapCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getScopeMaps()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myScopeMap",
+ new ScopeMapInner()
+ .withDescription("Developer Scopes")
+ .withActions(
+ Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/delete")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsDeleteSamples.java
new file mode 100644
index 0000000000000..5962ad94c6076
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ScopeMaps Delete. */
+public final class ScopeMapsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/ScopeMapDelete.json
+ */
+ /**
+ * Sample code: ScopeMapDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void scopeMapDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getScopeMaps()
+ .delete("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsGetSamples.java
new file mode 100644
index 0000000000000..e9fef3b6622fb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ScopeMaps Get. */
+public final class ScopeMapsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/ScopeMapGet.json
+ */
+ /**
+ * Sample code: ScopeMapGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void scopeMapGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getScopeMaps()
+ .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsListSamples.java
new file mode 100644
index 0000000000000..d45d7e1dc09dc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ScopeMaps List. */
+public final class ScopeMapsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/ScopeMapList.json
+ */
+ /**
+ * Sample code: ScopeMapList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void scopeMapList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getScopeMaps()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsUpdateSamples.java
new file mode 100644
index 0000000000000..8e215466b1ed6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/ScopeMapsUpdateSamples.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.ScopeMapUpdateParameters;
+import java.util.Arrays;
+
+/** Samples for ScopeMaps Update. */
+public final class ScopeMapsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/ScopeMapUpdate.json
+ */
+ /**
+ * Sample code: ScopeMapUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void scopeMapUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getScopeMaps()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myScopeMap",
+ new ScopeMapUpdateParameters()
+ .withDescription("Developer Scopes")
+ .withActions(
+ Arrays
+ .asList("repositories/myrepository/contentWrite", "repositories/myrepository/contentRead")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsCreateSamples.java
new file mode 100644
index 0000000000000..389350301d0cc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsCreateSamples.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.TaskRunInner;
+import com.azure.resourcemanager.containerregistry.models.Architecture;
+import com.azure.resourcemanager.containerregistry.models.Credentials;
+import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest;
+import com.azure.resourcemanager.containerregistry.models.OS;
+import com.azure.resourcemanager.containerregistry.models.PlatformProperties;
+import java.util.Arrays;
+
+/** Samples for TaskRuns Create. */
+public final class TaskRunsCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json
+ */
+ /**
+ * Sample code: TaskRuns_Create.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void taskRunsCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTaskRuns()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myRun",
+ new TaskRunInner()
+ .withRunRequest(
+ new EncodedTaskRunRequest()
+ .withEncodedTaskContent("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K")
+ .withEncodedValuesContent("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg==")
+ .withValues(Arrays.asList())
+ .withPlatform(
+ new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withCredentials(new Credentials()))
+ .withForceUpdateTag("test"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsDeleteSamples.java
new file mode 100644
index 0000000000000..6aa570ded1fb6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TaskRuns Delete. */
+public final class TaskRunsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json
+ */
+ /**
+ * Sample code: TaskRuns_Delete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void taskRunsDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTaskRuns()
+ .delete("myResourceGroup", "myRegistry", "myRun", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetDetailsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetDetailsSamples.java
new file mode 100644
index 0000000000000..3d893514c36a4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetDetailsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TaskRuns GetDetails. */
+public final class TaskRunsGetDetailsSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json
+ */
+ /**
+ * Sample code: TaskRuns_GetDetails.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void taskRunsGetDetails(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTaskRuns()
+ .getDetailsWithResponse("myResourceGroup", "myRegistry", "myRun", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetSamples.java
new file mode 100644
index 0000000000000..185ee2a006582
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TaskRuns Get. */
+public final class TaskRunsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json
+ */
+ /**
+ * Sample code: TaskRuns_Get.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void taskRunsGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTaskRuns()
+ .getWithResponse("myResourceGroup", "myRegistry", "myRun", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsListSamples.java
new file mode 100644
index 0000000000000..b872e0d1c1fba
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TaskRuns List. */
+public final class TaskRunsListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json
+ */
+ /**
+ * Sample code: TaskRuns_List.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void taskRunsList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTaskRuns()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsUpdateSamples.java
new file mode 100644
index 0000000000000..62b1b23488f24
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsUpdateSamples.java
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.Architecture;
+import com.azure.resourcemanager.containerregistry.models.Credentials;
+import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest;
+import com.azure.resourcemanager.containerregistry.models.OS;
+import com.azure.resourcemanager.containerregistry.models.PlatformProperties;
+import com.azure.resourcemanager.containerregistry.models.TaskRunUpdateParameters;
+import java.util.Arrays;
+
+/** Samples for TaskRuns Update. */
+public final class TaskRunsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json
+ */
+ /**
+ * Sample code: TaskRuns_Update.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void taskRunsUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTaskRuns()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myRun",
+ new TaskRunUpdateParameters()
+ .withRunRequest(
+ new EncodedTaskRunRequest()
+ .withIsArchiveEnabled(true)
+ .withEncodedTaskContent("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K")
+ .withEncodedValuesContent("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg==")
+ .withValues(Arrays.asList())
+ .withPlatform(
+ new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withCredentials(new Credentials()))
+ .withForceUpdateTag("test"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksCreateSamples.java
new file mode 100644
index 0000000000000..902ceff97c3ec
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksCreateSamples.java
@@ -0,0 +1,371 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner;
+import com.azure.resourcemanager.containerregistry.models.AgentProperties;
+import com.azure.resourcemanager.containerregistry.models.Architecture;
+import com.azure.resourcemanager.containerregistry.models.Argument;
+import com.azure.resourcemanager.containerregistry.models.AuthInfo;
+import com.azure.resourcemanager.containerregistry.models.BaseImageTrigger;
+import com.azure.resourcemanager.containerregistry.models.BaseImageTriggerType;
+import com.azure.resourcemanager.containerregistry.models.DockerTaskStep;
+import com.azure.resourcemanager.containerregistry.models.IdentityProperties;
+import com.azure.resourcemanager.containerregistry.models.OS;
+import com.azure.resourcemanager.containerregistry.models.PlatformProperties;
+import com.azure.resourcemanager.containerregistry.models.ResourceIdentityType;
+import com.azure.resourcemanager.containerregistry.models.SourceControlType;
+import com.azure.resourcemanager.containerregistry.models.SourceProperties;
+import com.azure.resourcemanager.containerregistry.models.SourceTrigger;
+import com.azure.resourcemanager.containerregistry.models.SourceTriggerEvent;
+import com.azure.resourcemanager.containerregistry.models.TaskStatus;
+import com.azure.resourcemanager.containerregistry.models.TimerTrigger;
+import com.azure.resourcemanager.containerregistry.models.TokenType;
+import com.azure.resourcemanager.containerregistry.models.TriggerProperties;
+import com.azure.resourcemanager.containerregistry.models.UpdateTriggerPayloadType;
+import com.azure.resourcemanager.containerregistry.models.UserIdentityProperties;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Tasks Create. */
+public final class TasksCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json
+ */
+ /**
+ * Sample code: Tasks_Create_WithUserIdentities_WithSystemIdentity.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksCreateWithUserIdentitiesWithSystemIdentity(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "mytTask",
+ new TaskInner()
+ .withLocation("eastus")
+ .withTags(mapOf("testkey", "value"))
+ .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
+ .withStatus(TaskStatus.ENABLED)
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withStep(
+ new DockerTaskStep()
+ .withContextPath("src")
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(false)
+ .withDockerFilePath("src/DockerFile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument()
+ .withName("mytestargument")
+ .withValue("mytestvalue")
+ .withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true))))
+ .withTrigger(
+ new TriggerProperties()
+ .withTimerTriggers(
+ Arrays
+ .asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger")))
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTrigger()
+ .withSourceRepository(
+ new SourceProperties()
+ .withSourceControlType(SourceControlType.GITHUB)
+ .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs")
+ .withBranch("master")
+ .withSourceControlAuthProperties(
+ new AuthInfo().withTokenType(TokenType.PAT).withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger")))
+ .withBaseImageTrigger(
+ new BaseImageTrigger()
+ .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME)
+ .withName("myBaseImageTrigger")))
+ .withIsSystemTask(false),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json
+ */
+ /**
+ * Sample code: Tasks_Create.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "mytTask",
+ new TaskInner()
+ .withLocation("eastus")
+ .withTags(mapOf("testkey", "value"))
+ .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED))
+ .withStatus(TaskStatus.ENABLED)
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withStep(
+ new DockerTaskStep()
+ .withContextPath("src")
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(false)
+ .withDockerFilePath("src/DockerFile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument()
+ .withName("mytestargument")
+ .withValue("mytestvalue")
+ .withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true))))
+ .withTrigger(
+ new TriggerProperties()
+ .withTimerTriggers(
+ Arrays
+ .asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger")))
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTrigger()
+ .withSourceRepository(
+ new SourceProperties()
+ .withSourceControlType(SourceControlType.GITHUB)
+ .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs")
+ .withBranch("master")
+ .withSourceControlAuthProperties(
+ new AuthInfo().withTokenType(TokenType.PAT).withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger")))
+ .withBaseImageTrigger(
+ new BaseImageTrigger()
+ .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME)
+ .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo")
+ .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.TOKEN)
+ .withName("myBaseImageTrigger")))
+ .withLogTemplate("acr/tasks:{{.Run.OS}}")
+ .withIsSystemTask(false),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json
+ */
+ /**
+ * Sample code: Tasks_Create_WithSystemAndUserIdentities.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksCreateWithSystemAndUserIdentities(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "mytTask",
+ new TaskInner()
+ .withLocation("eastus")
+ .withTags(mapOf("testkey", "value"))
+ .withIdentity(
+ new IdentityProperties()
+ .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2",
+ new UserIdentityProperties())))
+ .withStatus(TaskStatus.ENABLED)
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withStep(
+ new DockerTaskStep()
+ .withContextPath("src")
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(false)
+ .withDockerFilePath("src/DockerFile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument()
+ .withName("mytestargument")
+ .withValue("mytestvalue")
+ .withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true))))
+ .withTrigger(
+ new TriggerProperties()
+ .withTimerTriggers(
+ Arrays
+ .asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger")))
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTrigger()
+ .withSourceRepository(
+ new SourceProperties()
+ .withSourceControlType(SourceControlType.GITHUB)
+ .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs")
+ .withBranch("master")
+ .withSourceControlAuthProperties(
+ new AuthInfo().withTokenType(TokenType.PAT).withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger")))
+ .withBaseImageTrigger(
+ new BaseImageTrigger()
+ .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME)
+ .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo")
+ .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT)
+ .withName("myBaseImageTrigger")))
+ .withIsSystemTask(false),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json
+ */
+ /**
+ * Sample code: Tasks_Create_WithUserIdentities.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksCreateWithUserIdentities(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "mytTask",
+ new TaskInner()
+ .withLocation("eastus")
+ .withTags(mapOf("testkey", "value"))
+ .withIdentity(
+ new IdentityProperties()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new UserIdentityProperties(),
+ "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2",
+ new UserIdentityProperties())))
+ .withStatus(TaskStatus.ENABLED)
+ .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
+ .withAgentConfiguration(new AgentProperties().withCpu(2))
+ .withStep(
+ new DockerTaskStep()
+ .withContextPath("src")
+ .withImageNames(Arrays.asList("azurerest:testtag"))
+ .withIsPushEnabled(true)
+ .withNoCache(false)
+ .withDockerFilePath("src/DockerFile")
+ .withArguments(
+ Arrays
+ .asList(
+ new Argument()
+ .withName("mytestargument")
+ .withValue("mytestvalue")
+ .withIsSecret(false),
+ new Argument()
+ .withName("mysecrettestargument")
+ .withValue("mysecrettestvalue")
+ .withIsSecret(true))))
+ .withTrigger(
+ new TriggerProperties()
+ .withTimerTriggers(
+ Arrays
+ .asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger")))
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTrigger()
+ .withSourceRepository(
+ new SourceProperties()
+ .withSourceControlType(SourceControlType.GITHUB)
+ .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs")
+ .withBranch("master")
+ .withSourceControlAuthProperties(
+ new AuthInfo().withTokenType(TokenType.PAT).withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger")))
+ .withBaseImageTrigger(
+ new BaseImageTrigger()
+ .withBaseImageTriggerType(BaseImageTriggerType.RUNTIME)
+ .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo")
+ .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT)
+ .withName("myBaseImageTrigger")))
+ .withIsSystemTask(false),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json
+ */
+ /**
+ * Sample code: Tasks_Create_QuickTask.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksCreateQuickTask(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "quicktask",
+ new TaskInner()
+ .withLocation("eastus")
+ .withTags(mapOf("testkey", "value"))
+ .withStatus(TaskStatus.ENABLED)
+ .withLogTemplate("acr/tasks:{{.Run.OS}}")
+ .withIsSystemTask(true),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksDeleteSamples.java
new file mode 100644
index 0000000000000..3686afe3f7bf0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tasks Delete. */
+public final class TasksDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json
+ */
+ /**
+ * Sample code: Tasks_Delete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .delete("myResourceGroup", "myRegistry", "myTask", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetDetailsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetDetailsSamples.java
new file mode 100644
index 0000000000000..da1609ff21cdf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetDetailsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tasks GetDetails. */
+public final class TasksGetDetailsSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json
+ */
+ /**
+ * Sample code: Tasks_GetDetails.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksGetDetails(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .getDetailsWithResponse("myResourceGroup", "myRegistry", "myTask", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetSamples.java
new file mode 100644
index 0000000000000..bdc7892f50846
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tasks Get. */
+public final class TasksGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json
+ */
+ /**
+ * Sample code: Tasks_Get.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .getWithResponse("myResourceGroup", "myRegistry", "myTask", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksListSamples.java
new file mode 100644
index 0000000000000..e4414aad531dc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tasks List. */
+public final class TasksListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json
+ */
+ /**
+ * Sample code: Tasks_List.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksUpdateSamples.java
new file mode 100644
index 0000000000000..4d596b8ad3b20
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksUpdateSamples.java
@@ -0,0 +1,280 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.AgentProperties;
+import com.azure.resourcemanager.containerregistry.models.AuthInfoUpdateParameters;
+import com.azure.resourcemanager.containerregistry.models.Credentials;
+import com.azure.resourcemanager.containerregistry.models.CustomRegistryCredentials;
+import com.azure.resourcemanager.containerregistry.models.DockerBuildStepUpdateParameters;
+import com.azure.resourcemanager.containerregistry.models.SecretObject;
+import com.azure.resourcemanager.containerregistry.models.SecretObjectType;
+import com.azure.resourcemanager.containerregistry.models.SourceTriggerEvent;
+import com.azure.resourcemanager.containerregistry.models.SourceTriggerUpdateParameters;
+import com.azure.resourcemanager.containerregistry.models.SourceUpdateParameters;
+import com.azure.resourcemanager.containerregistry.models.TaskStatus;
+import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters;
+import com.azure.resourcemanager.containerregistry.models.TokenType;
+import com.azure.resourcemanager.containerregistry.models.TriggerUpdateParameters;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Tasks Update. */
+public final class TasksUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json
+ */
+ /**
+ * Sample code: Tasks_Update_QuickTask.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksUpdateQuickTask(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "quicktask",
+ new TaskUpdateParameters()
+ .withTags(mapOf("testkey", "value"))
+ .withStatus(TaskStatus.ENABLED)
+ .withLogTemplate("acr/tasks:{{.Run.OS}}"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json
+ */
+ /**
+ * Sample code: Tasks_Update_WithMSICustomCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksUpdateWithMSICustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myTask",
+ new TaskUpdateParameters()
+ .withTags(mapOf("testkey", "value"))
+ .withStatus(TaskStatus.ENABLED)
+ .withAgentConfiguration(new AgentProperties().withCpu(3))
+ .withStep(
+ new DockerBuildStepUpdateParameters()
+ .withImageNames(Arrays.asList("azurerest:testtag1"))
+ .withDockerFilePath("src/DockerFile"))
+ .withTrigger(
+ new TriggerUpdateParameters()
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTriggerUpdateParameters()
+ .withSourceRepository(
+ new SourceUpdateParameters()
+ .withSourceControlAuthProperties(
+ new AuthInfoUpdateParameters()
+ .withTokenType(TokenType.PAT)
+ .withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger"))))
+ .withCredentials(
+ new Credentials()
+ .withCustomRegistries(
+ mapOf(
+ "myregistry.azurecr.io",
+ new CustomRegistryCredentials().withIdentity("[system]")))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json
+ */
+ /**
+ * Sample code: Tasks_Update_WithKeyVaultCustomCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksUpdateWithKeyVaultCustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myTask",
+ new TaskUpdateParameters()
+ .withTags(mapOf("testkey", "value"))
+ .withStatus(TaskStatus.ENABLED)
+ .withAgentConfiguration(new AgentProperties().withCpu(3))
+ .withStep(
+ new DockerBuildStepUpdateParameters()
+ .withImageNames(Arrays.asList("azurerest:testtag1"))
+ .withDockerFilePath("src/DockerFile"))
+ .withTrigger(
+ new TriggerUpdateParameters()
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTriggerUpdateParameters()
+ .withSourceRepository(
+ new SourceUpdateParameters()
+ .withSourceControlAuthProperties(
+ new AuthInfoUpdateParameters()
+ .withTokenType(TokenType.PAT)
+ .withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger"))))
+ .withCredentials(
+ new Credentials()
+ .withCustomRegistries(
+ mapOf(
+ "myregistry.azurecr.io",
+ new CustomRegistryCredentials()
+ .withUsername(
+ new SecretObject()
+ .withValue("https://myacbvault.vault.azure.net/secrets/username")
+ .withType(SecretObjectType.VAULTSECRET))
+ .withPassword(
+ new SecretObject()
+ .withValue("https://myacbvault.vault.azure.net/secrets/password")
+ .withType(SecretObjectType.VAULTSECRET))
+ .withIdentity("[system]")))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json
+ */
+ /**
+ * Sample code: Tasks_Update.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myTask",
+ new TaskUpdateParameters()
+ .withTags(mapOf("testkey", "value"))
+ .withStatus(TaskStatus.ENABLED)
+ .withAgentConfiguration(new AgentProperties().withCpu(3))
+ .withStep(
+ new DockerBuildStepUpdateParameters()
+ .withImageNames(Arrays.asList("azurerest:testtag1"))
+ .withDockerFilePath("src/DockerFile"))
+ .withTrigger(
+ new TriggerUpdateParameters()
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTriggerUpdateParameters()
+ .withSourceRepository(
+ new SourceUpdateParameters()
+ .withSourceControlAuthProperties(
+ new AuthInfoUpdateParameters()
+ .withTokenType(TokenType.PAT)
+ .withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger"))))
+ .withCredentials(
+ new Credentials()
+ .withCustomRegistries(
+ mapOf(
+ "myregistry.azurecr.io",
+ new CustomRegistryCredentials()
+ .withUsername(
+ new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE))
+ .withPassword(
+ new SecretObject()
+ .withValue("https://myacbvault.vault.azure.net/secrets/password")
+ .withType(SecretObjectType.VAULTSECRET))
+ .withIdentity("[system]"))))
+ .withLogTemplate("acr/tasks:{{.Run.OS}}"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json
+ */
+ /**
+ * Sample code: Tasks_Update_WithOpaqueCustomCredentials.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tasksUpdateWithOpaqueCustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTasks()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myTask",
+ new TaskUpdateParameters()
+ .withTags(mapOf("testkey", "value"))
+ .withStatus(TaskStatus.ENABLED)
+ .withAgentConfiguration(new AgentProperties().withCpu(3))
+ .withStep(
+ new DockerBuildStepUpdateParameters()
+ .withImageNames(Arrays.asList("azurerest:testtag1"))
+ .withDockerFilePath("src/DockerFile"))
+ .withTrigger(
+ new TriggerUpdateParameters()
+ .withSourceTriggers(
+ Arrays
+ .asList(
+ new SourceTriggerUpdateParameters()
+ .withSourceRepository(
+ new SourceUpdateParameters()
+ .withSourceControlAuthProperties(
+ new AuthInfoUpdateParameters()
+ .withTokenType(TokenType.PAT)
+ .withToken("xxxxx")))
+ .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT))
+ .withName("mySourceTrigger"))))
+ .withCredentials(
+ new Credentials()
+ .withCustomRegistries(
+ mapOf(
+ "myregistry.azurecr.io",
+ new CustomRegistryCredentials()
+ .withUsername(
+ new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE))
+ .withPassword(
+ new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensCreateSamples.java
new file mode 100644
index 0000000000000..0a5ca09c90065
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensCreateSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.fluent.models.TokenInner;
+import com.azure.resourcemanager.containerregistry.models.TokenCertificate;
+import com.azure.resourcemanager.containerregistry.models.TokenCertificateName;
+import com.azure.resourcemanager.containerregistry.models.TokenCredentialsProperties;
+import com.azure.resourcemanager.containerregistry.models.TokenStatus;
+import java.util.Arrays;
+
+/** Samples for Tokens Create. */
+public final class TokensCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/TokenCreate.json
+ */
+ /**
+ * Sample code: TokenCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tokenCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTokens()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myToken",
+ new TokenInner()
+ .withScopeMapId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap")
+ .withCredentials(
+ new TokenCredentialsProperties()
+ .withCertificates(
+ Arrays
+ .asList(
+ new TokenCertificate()
+ .withName(TokenCertificateName.CERTIFICATE1)
+ .withEncodedPemCertificate(
+ "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="))))
+ .withStatus(TokenStatus.DISABLED),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensDeleteSamples.java
new file mode 100644
index 0000000000000..d68d1232ef891
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tokens Delete. */
+public final class TokensDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/TokenDelete.json
+ */
+ /**
+ * Sample code: TokenDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tokenDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTokens()
+ .delete("myResourceGroup", "myRegistry", "myToken", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensGetSamples.java
new file mode 100644
index 0000000000000..706216100a9f1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tokens Get. */
+public final class TokensGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/TokenGet.json
+ */
+ /**
+ * Sample code: TokenGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tokenGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTokens()
+ .getWithResponse("myResourceGroup", "myRegistry", "myToken", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensListSamples.java
new file mode 100644
index 0000000000000..72a438ec3ba9a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Tokens List. */
+public final class TokensListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/TokenList.json
+ */
+ /**
+ * Sample code: TokenList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tokenList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTokens()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensUpdateSamples.java
new file mode 100644
index 0000000000000..fed29d5a2b714
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TokensUpdateSamples.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.TokenCertificate;
+import com.azure.resourcemanager.containerregistry.models.TokenCertificateName;
+import com.azure.resourcemanager.containerregistry.models.TokenCredentialsProperties;
+import com.azure.resourcemanager.containerregistry.models.TokenUpdateParameters;
+import java.util.Arrays;
+
+/** Samples for Tokens Update. */
+public final class TokensUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-05-01-preview/examples/TokenUpdate.json
+ */
+ /**
+ * Sample code: TokenUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void tokenUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getTokens()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myToken",
+ new TokenUpdateParameters()
+ .withScopeMapId(
+ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap")
+ .withCredentials(
+ new TokenCredentialsProperties()
+ .withCertificates(
+ Arrays
+ .asList(
+ new TokenCertificate()
+ .withName(TokenCertificateName.CERTIFICATE1)
+ .withEncodedPemCertificate(
+ "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==")))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksCreateSamples.java
new file mode 100644
index 0000000000000..7c59126c91855
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksCreateSamples.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.WebhookAction;
+import com.azure.resourcemanager.containerregistry.models.WebhookCreateParameters;
+import com.azure.resourcemanager.containerregistry.models.WebhookStatus;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Webhooks Create. */
+public final class WebhooksCreateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookCreate.json
+ */
+ /**
+ * Sample code: WebhookCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .create(
+ "myResourceGroup",
+ "myRegistry",
+ "myWebhook",
+ new WebhookCreateParameters()
+ .withTags(mapOf("key", "value"))
+ .withLocation("westus")
+ .withServiceUri("http://myservice.com")
+ .withCustomHeaders(
+ mapOf("Authorization", "Basic 000000000000000000000000000000000000000000000000000"))
+ .withStatus(WebhookStatus.ENABLED)
+ .withScope("myRepository")
+ .withActions(Arrays.asList(WebhookAction.PUSH)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksDeleteSamples.java
new file mode 100644
index 0000000000000..475766f6f3089
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Webhooks Delete. */
+public final class WebhooksDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookDelete.json
+ */
+ /**
+ * Sample code: WebhookDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .delete("myResourceGroup", "myRegistry", "myWebhook", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksGetCallbackConfigSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksGetCallbackConfigSamples.java
new file mode 100644
index 0000000000000..8d7994c9dbbe6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksGetCallbackConfigSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Webhooks GetCallbackConfig. */
+public final class WebhooksGetCallbackConfigSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookGetCallbackConfig.json
+ */
+ /**
+ * Sample code: WebhookGetCallbackConfig.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookGetCallbackConfig(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .getCallbackConfigWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksGetSamples.java
new file mode 100644
index 0000000000000..52a03afdd4e5e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Webhooks Get. */
+public final class WebhooksGetSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookGet.json
+ */
+ /**
+ * Sample code: WebhookGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .getWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksListEventsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksListEventsSamples.java
new file mode 100644
index 0000000000000..0b995bb2d9240
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksListEventsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Webhooks ListEvents. */
+public final class WebhooksListEventsSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookListEvents.json
+ */
+ /**
+ * Sample code: WebhookListEvents.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookListEvents(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .listEvents("myResourceGroup", "myRegistry", "myWebhook", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksListSamples.java
new file mode 100644
index 0000000000000..0ce942622700d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Webhooks List. */
+public final class WebhooksListSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookList.json
+ */
+ /**
+ * Sample code: WebhookList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .list("myResourceGroup", "myRegistry", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksPingSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksPingSamples.java
new file mode 100644
index 0000000000000..83b526064af08
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksPingSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Webhooks Ping. */
+public final class WebhooksPingSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookPing.json
+ */
+ /**
+ * Sample code: WebhookPing.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookPing(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .pingWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksUpdateSamples.java
new file mode 100644
index 0000000000000..c3a00c56fc886
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/WebhooksUpdateSamples.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerregistry.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerregistry.models.WebhookAction;
+import com.azure.resourcemanager.containerregistry.models.WebhookStatus;
+import com.azure.resourcemanager.containerregistry.models.WebhookUpdateParameters;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Webhooks Update. */
+public final class WebhooksUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-12-01-preview/examples/WebhookUpdate.json
+ */
+ /**
+ * Sample code: WebhookUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void webhookUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .containerRegistries()
+ .manager()
+ .serviceClient()
+ .getWebhooks()
+ .update(
+ "myResourceGroup",
+ "myRegistry",
+ "myWebhook",
+ new WebhookUpdateParameters()
+ .withTags(mapOf("key", "value"))
+ .withServiceUri("http://myservice.com")
+ .withCustomHeaders(
+ mapOf("Authorization", "Basic 000000000000000000000000000000000000000000000000000"))
+ .withStatus(WebhookStatus.ENABLED)
+ .withScope("myRepository")
+ .withActions(Arrays.asList(WebhookAction.PUSH)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..b1cd77c420bd6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsCreateOrUpdateSamples.java
@@ -0,0 +1,521 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.AgentPoolInner;
+import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
+import com.azure.resourcemanager.containerservice.models.Code;
+import com.azure.resourcemanager.containerservice.models.CreationData;
+import com.azure.resourcemanager.containerservice.models.GpuInstanceProfile;
+import com.azure.resourcemanager.containerservice.models.KubeletConfig;
+import com.azure.resourcemanager.containerservice.models.LinuxOSConfig;
+import com.azure.resourcemanager.containerservice.models.OSDiskType;
+import com.azure.resourcemanager.containerservice.models.OSType;
+import com.azure.resourcemanager.containerservice.models.Ossku;
+import com.azure.resourcemanager.containerservice.models.PowerState;
+import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy;
+import com.azure.resourcemanager.containerservice.models.ScaleSetPriority;
+import com.azure.resourcemanager.containerservice.models.SysctlConfig;
+import com.azure.resourcemanager.containerservice.models.WorkloadRuntime;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AgentPools CreateOrUpdate. */
+public final class AgentPoolsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_EnableFIPS.json
+ */
+ /**
+ * Sample code: Create Agent Pool with FIPS enabled OS.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithFIPSEnabledOS(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withEnableFips(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPools_Update.json
+ */
+ /**
+ * Sample code: Update Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withMaxCount(2)
+ .withMinCount(2)
+ .withEnableAutoScaling(true)
+ .withOrchestratorVersion("")
+ .withScaleSetPriority(ScaleSetPriority.SPOT)
+ .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE)
+ .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_GPUMIG.json
+ */
+ /**
+ * Sample code: Create Agent Pool with GPUMIG.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithGPUMIG(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_ND96asr_v4")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withKubeletConfig(
+ new KubeletConfig()
+ .withCpuManagerPolicy("static")
+ .withCpuCfsQuota(true)
+ .withCpuCfsQuotaPeriod("200ms")
+ .withImageGcHighThreshold(90)
+ .withImageGcLowThreshold(70)
+ .withTopologyManagerPolicy("best-effort")
+ .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn"))
+ .withFailSwapOn(false))
+ .withLinuxOSConfig(
+ new LinuxOSConfig()
+ .withSysctls(
+ new SysctlConfig()
+ .withNetCoreWmemDefault(12345)
+ .withNetIpv4TcpTwReuse(true)
+ .withNetIpv4IpLocalPortRange("20000 60000")
+ .withKernelThreadsMax(99999))
+ .withTransparentHugePageEnabled("always")
+ .withTransparentHugePageDefrag("madvise")
+ .withSwapFileSizeMB(1500))
+ .withGpuInstanceProfile(GpuInstanceProfile.MIG2G),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_Update.json
+ */
+ /**
+ * Sample code: Create/Update Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withMode(AgentPoolMode.USER)
+ .withOrchestratorVersion("")
+ .withScaleSetPriority(ScaleSetPriority.SPOT)
+ .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE)
+ .withTags(mapOf("name1", "val1"))
+ .withNodeLabels(mapOf("key1", "val1"))
+ .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPools_Start.json
+ */
+ /**
+ * Sample code: Start Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void startAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner().withPowerState(new PowerState().withCode(Code.RUNNING)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_Spot.json
+ */
+ /**
+ * Sample code: Create Spot Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createSpotAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withScaleSetPriority(ScaleSetPriority.SPOT)
+ .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE)
+ .withTags(mapOf("name1", "val1"))
+ .withNodeLabels(mapOf("key1", "val1"))
+ .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_Ephemeral.json
+ */
+ /**
+ * Sample code: Create Agent Pool with Ephemeral OS Disk.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithEphemeralOSDisk(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsDiskSizeGB(64)
+ .withOsDiskType(OSDiskType.EPHEMERAL)
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion(""),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json
+ */
+ /**
+ * Sample code: Create Agent Pool with EncryptionAtHost enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithEncryptionAtHostEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withEnableEncryptionAtHost(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_EnableUltraSSD.json
+ */
+ /**
+ * Sample code: Create Agent Pool with UltraSSD enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithUltraSSDEnabled(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withEnableUltraSsd(true),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_WasmWasi.json
+ */
+ /**
+ * Sample code: Create Agent Pool with Krustlet and the WASI runtime.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithKrustletAndTheWASIRuntime(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsDiskSizeGB(64)
+ .withWorkloadRuntime(WorkloadRuntime.WASM_WASI)
+ .withOsType(OSType.LINUX)
+ .withMode(AgentPoolMode.USER)
+ .withOrchestratorVersion(""),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_Snapshot.json
+ */
+ /**
+ * Sample code: Create Agent Pool using an agent pool snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolUsingAnAgentPoolSnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withEnableFips(true)
+ .withCreationData(
+ new CreationData()
+ .withSourceResourceId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_PPG.json
+ */
+ /**
+ * Sample code: Create Agent Pool with PPG.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithPPG(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withProximityPlacementGroupId(
+ "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_CustomNodeConfig.json
+ */
+ /**
+ * Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithKubeletConfigAndLinuxOSConfig(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOrchestratorVersion("")
+ .withKubeletConfig(
+ new KubeletConfig()
+ .withCpuManagerPolicy("static")
+ .withCpuCfsQuota(true)
+ .withCpuCfsQuotaPeriod("200ms")
+ .withImageGcHighThreshold(90)
+ .withImageGcLowThreshold(70)
+ .withTopologyManagerPolicy("best-effort")
+ .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn"))
+ .withFailSwapOn(false))
+ .withLinuxOSConfig(
+ new LinuxOSConfig()
+ .withSysctls(
+ new SysctlConfig()
+ .withNetCoreWmemDefault(12345)
+ .withNetIpv4TcpTwReuse(true)
+ .withNetIpv4IpLocalPortRange("20000 60000")
+ .withKernelThreadsMax(99999))
+ .withTransparentHugePageEnabled("always")
+ .withTransparentHugePageDefrag("madvise")
+ .withSwapFileSizeMB(1500)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPools_Stop.json
+ */
+ /**
+ * Sample code: Stop Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void stopAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner().withPowerState(new PowerState().withCode(Code.STOPPED)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsCreate_OSSKU.json
+ */
+ /**
+ * Sample code: Create Agent Pool with OSSKU.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAgentPoolWithOSSKU(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ "agentpool1",
+ new AgentPoolInner()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOsSku(Ossku.CBLMARINER)
+ .withOrchestratorVersion("")
+ .withKubeletConfig(
+ new KubeletConfig()
+ .withCpuManagerPolicy("static")
+ .withCpuCfsQuota(true)
+ .withCpuCfsQuotaPeriod("200ms")
+ .withImageGcHighThreshold(90)
+ .withImageGcLowThreshold(70)
+ .withTopologyManagerPolicy("best-effort")
+ .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn"))
+ .withFailSwapOn(false))
+ .withLinuxOSConfig(
+ new LinuxOSConfig()
+ .withSysctls(
+ new SysctlConfig()
+ .withNetCoreWmemDefault(12345)
+ .withNetIpv4TcpTwReuse(true)
+ .withNetIpv4IpLocalPortRange("20000 60000")
+ .withKernelThreadsMax(99999))
+ .withTransparentHugePageEnabled("always")
+ .withTransparentHugePageDefrag("madvise")
+ .withSwapFileSizeMB(1500)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsDeleteSamples.java
new file mode 100644
index 0000000000000..19caff7c9b054
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools Delete. */
+public final class AgentPoolsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsDelete.json
+ */
+ /**
+ * Sample code: Delete Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .delete("rg1", "clustername1", "agentpool1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java
new file mode 100644
index 0000000000000..0ff4099fd2aaa
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools GetAvailableAgentPoolVersions. */
+public final class AgentPoolsGetAvailableAgentPoolVersionsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json
+ */
+ /**
+ * Sample code: Get available versions for agent pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableVersionsForAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .getAvailableAgentPoolVersionsWithResponse("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetSamples.java
new file mode 100644
index 0000000000000..170f5f71b4898
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools Get. */
+public final class AgentPoolsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsGet.json
+ */
+ /**
+ * Sample code: Get Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .getWithResponse("rg1", "clustername1", "agentpool1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetUpgradeProfileSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetUpgradeProfileSamples.java
new file mode 100644
index 0000000000000..7b40ee3fc4987
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsGetUpgradeProfileSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools GetUpgradeProfile. */
+public final class AgentPoolsGetUpgradeProfileSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsGetUpgradeProfile.json
+ */
+ /**
+ * Sample code: Get Upgrade Profile for Agent Pool.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getUpgradeProfileForAgentPool(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .getUpgradeProfileWithResponse("rg1", "clustername1", "agentpool1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsListSamples.java
new file mode 100644
index 0000000000000..40dafe7102aed
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools List. */
+public final class AgentPoolsListSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsList.json
+ */
+ /**
+ * Sample code: List Agent Pools by Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAgentPoolsByManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.kubernetesClusters().manager().serviceClient().getAgentPools().list("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsUpgradeNodeImageVersionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsUpgradeNodeImageVersionSamples.java
new file mode 100644
index 0000000000000..43a1a2a02791f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/AgentPoolsUpgradeNodeImageVersionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AgentPools UpgradeNodeImageVersion. */
+public final class AgentPoolsUpgradeNodeImageVersionSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/AgentPoolsUpgradeNodeImageVersion.json
+ */
+ /**
+ * Sample code: Upgrade Agent Pool Node Image Version.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void upgradeAgentPoolNodeImageVersion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getAgentPools()
+ .upgradeNodeImageVersion("rg1", "clustername1", "agentpool1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ContainerServicesListOrchestratorsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ContainerServicesListOrchestratorsSamples.java
new file mode 100644
index 0000000000000..9861807ecc2f7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ContainerServicesListOrchestratorsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ContainerServices ListOrchestrators. */
+public final class ContainerServicesListOrchestratorsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-08-01/examples/ContainerServiceListOrchestrators.json
+ */
+ /**
+ * Sample code: List Container Service Orchestrators.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listContainerServiceOrchestrators(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getContainerServices()
+ .listOrchestratorsWithResponse("location1", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..bfb145d09124f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.MaintenanceConfigurationInner;
+import com.azure.resourcemanager.containerservice.models.TimeInWeek;
+import com.azure.resourcemanager.containerservice.models.TimeSpan;
+import com.azure.resourcemanager.containerservice.models.WeekDay;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+
+/** Samples for MaintenanceConfigurations CreateOrUpdate. */
+public final class MaintenanceConfigurationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/MaintenanceConfigurationsCreate_Update.json
+ */
+ /**
+ * Sample code: Create/Update Maintenance Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateMaintenanceConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getMaintenanceConfigurations()
+ .createOrUpdateWithResponse(
+ "rg1",
+ "clustername1",
+ "default",
+ new MaintenanceConfigurationInner()
+ .withTimeInWeek(
+ Arrays.asList(new TimeInWeek().withDay(WeekDay.MONDAY).withHourSlots(Arrays.asList(1, 2))))
+ .withNotAllowedTime(
+ Arrays
+ .asList(
+ new TimeSpan()
+ .withStart(OffsetDateTime.parse("2020-11-26T03:00:00Z"))
+ .withEnd(OffsetDateTime.parse("2020-11-30T12:00:00Z")))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsDeleteSamples.java
new file mode 100644
index 0000000000000..ba7ee5703fb3c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MaintenanceConfigurations Delete. */
+public final class MaintenanceConfigurationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/MaintenanceConfigurationsDelete.json
+ */
+ /**
+ * Sample code: Delete Maintenance Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteMaintenanceConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getMaintenanceConfigurations()
+ .deleteWithResponse("rg1", "clustername1", "default", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsGetSamples.java
new file mode 100644
index 0000000000000..b3be0bba253fb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MaintenanceConfigurations Get. */
+public final class MaintenanceConfigurationsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/MaintenanceConfigurationsGet.json
+ */
+ /**
+ * Sample code: Get Maintenance Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getMaintenanceConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getMaintenanceConfigurations()
+ .getWithResponse("rg1", "clustername1", "default", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsListByManagedClusterSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsListByManagedClusterSamples.java
new file mode 100644
index 0000000000000..a9e8ac8d109ec
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/MaintenanceConfigurationsListByManagedClusterSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MaintenanceConfigurations ListByManagedCluster. */
+public final class MaintenanceConfigurationsListByManagedClusterSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/MaintenanceConfigurationsList.json
+ */
+ /**
+ * Sample code: List maintenance configurations by Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listMaintenanceConfigurationsByManagedCluster(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getMaintenanceConfigurations()
+ .listByManagedCluster("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..19fd025947cf4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersCreateOrUpdateSamples.java
@@ -0,0 +1,1537 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.ManagedClusterInner;
+import com.azure.resourcemanager.containerservice.models.AgentPoolMode;
+import com.azure.resourcemanager.containerservice.models.AgentPoolType;
+import com.azure.resourcemanager.containerservice.models.ContainerServiceLinuxProfile;
+import com.azure.resourcemanager.containerservice.models.ContainerServiceNetworkProfile;
+import com.azure.resourcemanager.containerservice.models.ContainerServiceSshConfiguration;
+import com.azure.resourcemanager.containerservice.models.ContainerServiceSshPublicKey;
+import com.azure.resourcemanager.containerservice.models.CreationData;
+import com.azure.resourcemanager.containerservice.models.Expander;
+import com.azure.resourcemanager.containerservice.models.GpuInstanceProfile;
+import com.azure.resourcemanager.containerservice.models.LicenseType;
+import com.azure.resourcemanager.containerservice.models.LoadBalancerSku;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterAgentPoolProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterApiServerAccessProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterHttpProxyConfig;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterIdentity;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterManagedOutboundIpProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterNatGatewayProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterPodIdentityProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterPropertiesAutoScalerProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterSecurityProfileAzureDefender;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterSku;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterWindowsProfile;
+import com.azure.resourcemanager.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue;
+import com.azure.resourcemanager.containerservice.models.OSType;
+import com.azure.resourcemanager.containerservice.models.Ossku;
+import com.azure.resourcemanager.containerservice.models.OutboundType;
+import com.azure.resourcemanager.containerservice.models.ResourceIdentityType;
+import com.azure.resourcemanager.containerservice.models.ScaleDownMode;
+import com.azure.resourcemanager.containerservice.models.WindowsGmsaProfile;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ManagedClusters CreateOrUpdate. */
+public final class ManagedClustersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_HTTPProxy.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with HTTP proxy configured.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithHTTPProxyConfigured(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
+ .withHttpProxyConfig(
+ new ManagedClusterHttpProxyConfig()
+ .withHttpProxy("http://myproxy.server.com:8080")
+ .withHttpsProxy("https://myproxy.server.com:8080")
+ .withNoProxy(Arrays.asList("localhost", "127.0.0.1"))
+ .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_EnabledFIPS.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with FIPS enabled OS.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithFIPSEnabledOS(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableFips(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(false)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_SecurityProfile.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with Security Profile configured.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithSecurityProfileConfigured(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withSecurityProfile(
+ new ManagedClusterSecurityProfile()
+ .withAzureDefender(
+ new ManagedClusterSecurityProfileAzureDefender()
+ .withEnabled(true)
+ .withLogAnalyticsWorkspaceResourceId(
+ "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_PPG.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with PPG.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithPPG(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withProximityPlacementGroupId(
+ "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1")
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_UpdateWithAHUB.json
+ */
+ /**
+ * Sample code: Create/Update Managed Cluster with EnableAHUB.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateManagedClusterWithEnableAHUB(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withIdentity(
+ new ManagedClusterIdentity()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new ManagedServiceIdentityUserAssignedIdentitiesValue())))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withAvailabilityZones(Arrays.asList("1", "2", "3"))
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$")
+ .withLicenseType(LicenseType.WINDOWS_SERVER))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_PodIdentity.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with PodIdentity enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithPodIdentityEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withPodIdentityProfile(
+ new ManagedClusterPodIdentityProfile().withEnabled(true).withAllowNetworkPluginKubenet(true))
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_DisableRunCommand.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with RunCommand disabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithRunCommandDisabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableEncryptionAtHost(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with user-assigned NAT gateway as outbound type.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithUserAssignedNATGatewayAsOutboundType(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(false)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.USER_ASSIGNED_NATGATEWAY)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_Snapshot.json
+ */
+ /**
+ * Sample code: Create Managed Cluster using an agent pool snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterUsingAnAgentPoolSnapshot(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableFips(true)
+ .withCreationData(
+ new CreationData()
+ .withSourceResourceId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"))
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(false)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_OSSKU.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with OSSKU.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithOSSKU(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withOsSku(Ossku.CBLMARINER)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
+ .withHttpProxyConfig(
+ new ManagedClusterHttpProxyConfig()
+ .withHttpProxy("http://myproxy.server.com:8080")
+ .withHttpsProxy("https://myproxy.server.com:8080")
+ .withNoProxy(Arrays.asList("localhost", "127.0.0.1"))
+ .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_Update.json
+ */
+ /**
+ * Sample code: Create/Update Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withIdentity(
+ new ManagedClusterIdentity()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new ManagedServiceIdentityUserAssignedIdentitiesValue())))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withScaleDownMode(ScaleDownMode.DEALLOCATE)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withAvailabilityZones(Arrays.asList("1", "2", "3"))
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withBalanceSimilarNodeGroups("true")
+ .withExpander(Expander.PRIORITY)
+ .withMaxNodeProvisionTime("15m")
+ .withNewPodScaleUpDelay("1m")
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m")
+ .withSkipNodesWithSystemPods("false"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json
+ */
+ /**
+ * Sample code: Create Managed Private Cluster with fqdn subdomain specified.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedPrivateClusterWithFqdnSubdomainSpecified(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withFqdnSubdomain("domain1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableEncryptionAtHost(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withApiServerAccessProfile(
+ new ManagedClusterApiServerAccessProfile()
+ .withEnablePrivateCluster(true)
+ .withPrivateDnsZone(
+ "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_ManagedNATGateway.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with AKS-managed NAT gateway as outbound type.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithAKSManagedNATGatewayAsOutboundType(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(false)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.MANAGED_NATGATEWAY)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withNatGatewayProfile(
+ new ManagedClusterNatGatewayProfile()
+ .withManagedOutboundIpProfile(
+ new ManagedClusterManagedOutboundIpProfile().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json
+ */
+ /**
+ * Sample code: Create/Update AAD Managed Cluster with EnableAzureRBAC.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateAADManagedClusterWithEnableAzureRBAC(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withAvailabilityZones(Arrays.asList("1", "2", "3"))
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAadProfile(new ManagedClusterAadProfile().withManaged(true).withEnableAzureRbac(true))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_EnableUltraSSD.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with UltraSSD enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithUltraSSDEnabled(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableUltraSsd(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json
+ */
+ /**
+ * Sample code: Create/Update Managed Cluster with Windows gMSA enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateManagedClusterWithWindowsGMSAEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withIdentity(
+ new ManagedClusterIdentity()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new ManagedServiceIdentityUserAssignedIdentitiesValue())))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS1_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withAvailabilityZones(Arrays.asList("1", "2", "3"))
+ .withEnableNodePublicIp(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$")
+ .withGmsaProfile(new WindowsGmsaProfile().withEnabled(true)))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_GPUMIG.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with GPUMIG.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithGPUMIG(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_ND96asr_v4")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withGpuInstanceProfile(GpuInstanceProfile.MIG3G)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des")
+ .withHttpProxyConfig(
+ new ManagedClusterHttpProxyConfig()
+ .withHttpProxy("http://myproxy.server.com:8080")
+ .withHttpsProxy("https://myproxy.server.com:8080")
+ .withNoProxy(Arrays.asList("localhost", "127.0.0.1"))
+ .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with Node Public IP Prefix.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithNodePublicIPPrefix(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withNodePublicIpPrefixId(
+ "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix")
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json
+ */
+ /**
+ * Sample code: Create Managed Cluster with EncryptionAtHost enabled.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedClusterWithEncryptionAtHostEnabled(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableEncryptionAtHost(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withDiskEncryptionSetId(
+ "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json
+ */
+ /**
+ * Sample code: Create Managed Private Cluster with Public FQDN specified.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createManagedPrivateClusterWithPublicFQDNSpecified(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new ManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withSku(
+ new ManagedClusterSku()
+ .withName(ManagedClusterSkuName.BASIC)
+ .withTier(ManagedClusterSkuTier.FREE))
+ .withKubernetesVersion("")
+ .withDnsPrefix("dnsprefix1")
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new ManagedClusterAgentPoolProfile()
+ .withCount(3)
+ .withVmSize("Standard_DS2_v2")
+ .withOsType(OSType.LINUX)
+ .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS)
+ .withMode(AgentPoolMode.SYSTEM)
+ .withEnableNodePublicIp(true)
+ .withEnableEncryptionAtHost(true)
+ .withName("nodepool1")))
+ .withLinuxProfile(
+ new ContainerServiceLinuxProfile()
+ .withAdminUsername("azureuser")
+ .withSsh(
+ new ContainerServiceSshConfiguration()
+ .withPublicKeys(
+ Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata")))))
+ .withWindowsProfile(
+ new ManagedClusterWindowsProfile()
+ .withAdminUsername("azureuser")
+ .withAdminPassword("replacePassword1234$"))
+ .withServicePrincipalProfile(
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"))
+ .withAddonProfiles(mapOf())
+ .withEnableRbac(true)
+ .withEnablePodSecurityPolicy(true)
+ .withNetworkProfile(
+ new ContainerServiceNetworkProfile()
+ .withOutboundType(OutboundType.LOAD_BALANCER)
+ .withLoadBalancerSku(LoadBalancerSku.STANDARD)
+ .withLoadBalancerProfile(
+ new ManagedClusterLoadBalancerProfile()
+ .withManagedOutboundIPs(
+ new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))))
+ .withAutoScalerProfile(
+ new ManagedClusterPropertiesAutoScalerProfile()
+ .withScanInterval("20s")
+ .withScaleDownDelayAfterAdd("15m"))
+ .withApiServerAccessProfile(
+ new ManagedClusterApiServerAccessProfile()
+ .withEnablePrivateCluster(true)
+ .withEnablePrivateClusterPublicFqdn(true)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersDeleteSamples.java
new file mode 100644
index 0000000000000..c0fa7119f2867
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters Delete. */
+public final class ManagedClustersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersDelete.json
+ */
+ /**
+ * Sample code: Delete Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .delete("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetAccessProfileSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetAccessProfileSamples.java
new file mode 100644
index 0000000000000..7da367045a6c9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetAccessProfileSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters GetAccessProfile. */
+public final class ManagedClustersGetAccessProfileSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersGetAccessProfile.json
+ */
+ /**
+ * Sample code: Get Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .getAccessProfileWithResponse("rg1", "clustername1", "clusterUser", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..9240da2b5b28c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters GetByResourceGroup. */
+public final class ManagedClustersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersGet.json
+ */
+ /**
+ * Sample code: Get Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetCommandResultSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetCommandResultSamples.java
new file mode 100644
index 0000000000000..95b58d6169431
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetCommandResultSamples.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters GetCommandResult. */
+public final class ManagedClustersGetCommandResultSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/RunCommandResultFailed.json
+ */
+ /**
+ * Sample code: commandFailedResult.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void commandFailedResult(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/RunCommandResultSucceed.json
+ */
+ /**
+ * Sample code: commandSucceedResult.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void commandSucceedResult(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetOSOptionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetOSOptionsSamples.java
new file mode 100644
index 0000000000000..879af8e1ccdf8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetOSOptionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters GetOSOptions. */
+public final class ManagedClustersGetOSOptionsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ContainerServiceGetOSOptions.json
+ */
+ /**
+ * Sample code: Get Container Service OS Options.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getContainerServiceOSOptions(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .getOSOptionsWithResponse("location1", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetUpgradeProfileSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetUpgradeProfileSamples.java
new file mode 100644
index 0000000000000..e8222b76b5212
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersGetUpgradeProfileSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters GetUpgradeProfile. */
+public final class ManagedClustersGetUpgradeProfileSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersGetUpgradeProfile.json
+ */
+ /**
+ * Sample code: Get Upgrade Profile for Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getUpgradeProfileForManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .getUpgradeProfileWithResponse("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..b116387c89e6b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters ListByResourceGroup. */
+public final class ManagedClustersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersListByResourceGroup.json
+ */
+ /**
+ * Sample code: Get Managed Clusters by Resource Group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedClustersByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterAdminCredentialsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterAdminCredentialsSamples.java
new file mode 100644
index 0000000000000..72408ad69525a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterAdminCredentialsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters ListClusterAdminCredentials. */
+public final class ManagedClustersListClusterAdminCredentialsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersListClusterCredentialResult.json
+ */
+ /**
+ * Sample code: Get Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .listClusterAdminCredentialsWithResponse("rg1", "clustername1", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java
new file mode 100644
index 0000000000000..22a60c71ce264
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters ListClusterMonitoringUserCredentials. */
+public final class ManagedClustersListClusterMonitoringUserCredentialsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersListClusterCredentialResult.json
+ */
+ /**
+ * Sample code: Get Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .listClusterMonitoringUserCredentialsWithResponse("rg1", "clustername1", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterUserCredentialsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterUserCredentialsSamples.java
new file mode 100644
index 0000000000000..c5f9f7fb0d143
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListClusterUserCredentialsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters ListClusterUserCredentials. */
+public final class ManagedClustersListClusterUserCredentialsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersListClusterCredentialResult.json
+ */
+ /**
+ * Sample code: Get Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .listClusterUserCredentialsWithResponse("rg1", "clustername1", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java
new file mode 100644
index 0000000000000..4d68f4e88f016
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters ListOutboundNetworkDependenciesEndpoints. */
+public final class ManagedClustersListOutboundNetworkDependenciesEndpointsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/OutboundNetworkDependenciesEndpointsList.json
+ */
+ /**
+ * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listOutboundNetworkDependenciesEndpointsByManagedCluster(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .listOutboundNetworkDependenciesEndpoints("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListSamples.java
new file mode 100644
index 0000000000000..5c6ee4f586334
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters List. */
+public final class ManagedClustersListSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersList.json
+ */
+ /**
+ * Sample code: List Managed Clusters.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listManagedClusters(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.kubernetesClusters().manager().serviceClient().getManagedClusters().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersResetAadProfileSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersResetAadProfileSamples.java
new file mode 100644
index 0000000000000..97f8f522ef99c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersResetAadProfileSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterAadProfile;
+
+/** Samples for ManagedClusters ResetAadProfile. */
+public final class ManagedClustersResetAadProfileSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersResetAADProfile.json
+ */
+ /**
+ * Sample code: Reset AAD Profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void resetAADProfile(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .resetAadProfile(
+ "rg1",
+ "clustername1",
+ new ManagedClusterAadProfile()
+ .withClientAppId("clientappid")
+ .withServerAppId("serverappid")
+ .withServerAppSecret("serverappsecret")
+ .withTenantId("tenantid"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersResetServicePrincipalProfileSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersResetServicePrincipalProfileSamples.java
new file mode 100644
index 0000000000000..c43417879fe84
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersResetServicePrincipalProfileSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.models.ManagedClusterServicePrincipalProfile;
+
+/** Samples for ManagedClusters ResetServicePrincipalProfile. */
+public final class ManagedClustersResetServicePrincipalProfileSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersResetServicePrincipalProfile.json
+ */
+ /**
+ * Sample code: Reset Service Principal Profile.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void resetServicePrincipalProfile(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .resetServicePrincipalProfile(
+ "rg1",
+ "clustername1",
+ new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersRotateClusterCertificatesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersRotateClusterCertificatesSamples.java
new file mode 100644
index 0000000000000..380bf9ae70c8c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersRotateClusterCertificatesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters RotateClusterCertificates. */
+public final class ManagedClustersRotateClusterCertificatesSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersRotateClusterCertificates.json
+ */
+ /**
+ * Sample code: Rotate Cluster Certificates.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void rotateClusterCertificates(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .rotateClusterCertificates("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersRunCommandSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersRunCommandSamples.java
new file mode 100644
index 0000000000000..9d12bcf0afff5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersRunCommandSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.models.RunCommandRequest;
+
+/** Samples for ManagedClusters RunCommand. */
+public final class ManagedClustersRunCommandSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/RunCommandRequest.json
+ */
+ /**
+ * Sample code: submitNewCommand.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void submitNewCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .runCommand(
+ "rg1",
+ "clustername1",
+ new RunCommandRequest().withCommand("kubectl apply -f ns.yaml").withContext("").withClusterToken(""),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersStartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersStartSamples.java
new file mode 100644
index 0000000000000..7132bdfeca646
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersStartSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters Start. */
+public final class ManagedClustersStartSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersStart.json
+ */
+ /**
+ * Sample code: Start Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void startManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .start("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersStopSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersStopSamples.java
new file mode 100644
index 0000000000000..779ca1b3ba0c6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersStopSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ManagedClusters Stop. */
+public final class ManagedClustersStopSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersStop.json
+ */
+ /**
+ * Sample code: Stop Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void stopManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .stop("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersUpdateTagsSamples.java
new file mode 100644
index 0000000000000..8688a76ffe9f8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ManagedClustersUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ManagedClusters UpdateTags. */
+public final class ManagedClustersUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ManagedClustersUpdateTags.json
+ */
+ /**
+ * Sample code: Update Managed Cluster Tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateManagedClusterTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getManagedClusters()
+ .updateTags(
+ "rg1", "clustername1", new TagsObject().withTags(mapOf("archv3", "", "tier", "testing")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5485c60665da4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersCreateOrUpdateSamples.java
@@ -0,0 +1,98 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.OpenShiftManagedClusterInner;
+import com.azure.resourcemanager.containerservice.models.NetworkProfile;
+import com.azure.resourcemanager.containerservice.models.OSType;
+import com.azure.resourcemanager.containerservice.models.OpenShiftAgentPoolProfileRole;
+import com.azure.resourcemanager.containerservice.models.OpenShiftContainerServiceVMSize;
+import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAadIdentityProvider;
+import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAgentPoolProfile;
+import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterAuthProfile;
+import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterIdentityProvider;
+import com.azure.resourcemanager.containerservice.models.OpenShiftManagedClusterMasterPoolProfile;
+import com.azure.resourcemanager.containerservice.models.OpenShiftRouterProfile;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for OpenShiftManagedClusters CreateOrUpdate. */
+public final class OpenShiftManagedClustersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersCreate_Update.json
+ */
+ /**
+ * Sample code: Create/Update OpenShift Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateOpenShiftManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getOpenShiftManagedClusters()
+ .createOrUpdate(
+ "rg1",
+ "clustername1",
+ new OpenShiftManagedClusterInner()
+ .withLocation("location1")
+ .withTags(mapOf("archv2", "", "tier", "production"))
+ .withOpenShiftVersion("v3.11")
+ .withNetworkProfile(new NetworkProfile().withVnetCidr("10.0.0.0/8"))
+ .withRouterProfiles(Arrays.asList(new OpenShiftRouterProfile().withName("default")))
+ .withMasterPoolProfile(
+ new OpenShiftManagedClusterMasterPoolProfile()
+ .withName("master")
+ .withCount(3)
+ .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3)
+ .withSubnetCidr("10.0.0.0/24")
+ .withOsType(OSType.LINUX))
+ .withAgentPoolProfiles(
+ Arrays
+ .asList(
+ new OpenShiftManagedClusterAgentPoolProfile()
+ .withName("infra")
+ .withCount(2)
+ .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3)
+ .withSubnetCidr("10.0.0.0/24")
+ .withOsType(OSType.LINUX)
+ .withRole(OpenShiftAgentPoolProfileRole.INFRA),
+ new OpenShiftManagedClusterAgentPoolProfile()
+ .withName("compute")
+ .withCount(4)
+ .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3)
+ .withSubnetCidr("10.0.0.0/24")
+ .withOsType(OSType.LINUX)
+ .withRole(OpenShiftAgentPoolProfileRole.COMPUTE)))
+ .withAuthProfile(
+ new OpenShiftManagedClusterAuthProfile()
+ .withIdentityProviders(
+ Arrays
+ .asList(
+ new OpenShiftManagedClusterIdentityProvider()
+ .withName("Azure AD")
+ .withProvider(
+ new OpenShiftManagedClusterAadIdentityProvider()
+ .withClientId("clientId")
+ .withSecret("secret")
+ .withTenantId("tenantId")
+ .withCustomerAdminGroupId("customerAdminGroupId"))))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersDeleteSamples.java
new file mode 100644
index 0000000000000..12c26b6086f12
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for OpenShiftManagedClusters Delete. */
+public final class OpenShiftManagedClustersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersDelete.json
+ */
+ /**
+ * Sample code: Delete OpenShift Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteOpenShiftManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getOpenShiftManagedClusters()
+ .delete("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..c179244508b49
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for OpenShiftManagedClusters GetByResourceGroup. */
+public final class OpenShiftManagedClustersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersGet.json
+ */
+ /**
+ * Sample code: Get OpenShift Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getOpenShiftManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getOpenShiftManagedClusters()
+ .getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..d94b7190c3028
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for OpenShiftManagedClusters ListByResourceGroup. */
+public final class OpenShiftManagedClustersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersListByResourceGroup.json
+ */
+ /**
+ * Sample code: Get Managed Clusters by Resource Group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getManagedClustersByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getOpenShiftManagedClusters()
+ .listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersListSamples.java
new file mode 100644
index 0000000000000..33cc5e7f7cc82
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for OpenShiftManagedClusters List. */
+public final class OpenShiftManagedClustersListSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersList.json
+ */
+ /**
+ * Sample code: List Managed Clusters.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listManagedClusters(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.kubernetesClusters().manager().serviceClient().getOpenShiftManagedClusters().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersUpdateTagsSamples.java
new file mode 100644
index 0000000000000..fd13b7b1f307f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/OpenShiftManagedClustersUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for OpenShiftManagedClusters UpdateTags. */
+public final class OpenShiftManagedClustersUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersUpdateTags.json
+ */
+ /**
+ * Sample code: Update OpenShift Managed Cluster Tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateOpenShiftManagedClusterTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getOpenShiftManagedClusters()
+ .updateTags(
+ "rg1", "clustername1", new TagsObject().withTags(mapOf("archv3", "", "tier", "testing")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..4b75cb5092274
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Delete. */
+public final class PrivateEndpointConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/PrivateEndpointConnectionsDelete.json
+ */
+ /**
+ * Sample code: Delete Private Endpoint Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deletePrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .delete("rg1", "clustername1", "privateendpointconnection1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsGetSamples.java
new file mode 100644
index 0000000000000..3c7a43aa967f2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Get. */
+public final class PrivateEndpointConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/PrivateEndpointConnectionsGet.json
+ */
+ /**
+ * Sample code: Get Private Endpoint Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse("rg1", "clustername1", "privateendpointconnection1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsListSamples.java
new file mode 100644
index 0000000000000..1425fa9a7bcde
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsListSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections List. */
+public final class PrivateEndpointConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/PrivateEndpointConnectionsList.json
+ */
+ /**
+ * Sample code: List Private Endpoint Connections by Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listPrivateEndpointConnectionsByManagedCluster(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .listWithResponse("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsUpdateSamples.java
new file mode 100644
index 0000000000000..c50eba6a9cd4c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateEndpointConnectionsUpdateSamples.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.containerservice.models.ConnectionStatus;
+import com.azure.resourcemanager.containerservice.models.PrivateLinkServiceConnectionState;
+
+/** Samples for PrivateEndpointConnections Update. */
+public final class PrivateEndpointConnectionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/PrivateEndpointConnectionsUpdate.json
+ */
+ /**
+ * Sample code: Update Private Endpoint Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updatePrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .updateWithResponse(
+ "rg1",
+ "clustername1",
+ "privateendpointconnection1",
+ new PrivateEndpointConnectionInner()
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateLinkResourcesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateLinkResourcesListSamples.java
new file mode 100644
index 0000000000000..40cff23e46eab
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/PrivateLinkResourcesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkResources List. */
+public final class PrivateLinkResourcesListSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/PrivateLinkResourcesList.json
+ */
+ /**
+ * Sample code: List Private Link Resources by Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listPrivateLinkResourcesByManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getPrivateLinkResources()
+ .listWithResponse("rg1", "clustername1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ResolvePrivateLinkServiceIdPostSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ResolvePrivateLinkServiceIdPostSamples.java
new file mode 100644
index 0000000000000..590a541be2564
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/ResolvePrivateLinkServiceIdPostSamples.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.PrivateLinkResourceInner;
+
+/** Samples for ResolvePrivateLinkServiceId Post. */
+public final class ResolvePrivateLinkServiceIdPostSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/ResolvePrivateLinkServiceId.json
+ */
+ /**
+ * Sample code: Resolve the Private Link Service ID for Managed Cluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void resolveThePrivateLinkServiceIDForManagedCluster(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getResolvePrivateLinkServiceIds()
+ .postWithResponse(
+ "rg1", "clustername1", new PrivateLinkResourceInner().withName("management"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..b6776b5dfe02c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsCreateOrUpdateSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.fluent.models.SnapshotInner;
+import com.azure.resourcemanager.containerservice.models.CreationData;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Snapshots CreateOrUpdate. */
+public final class SnapshotsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/SnapshotsCreate.json
+ */
+ /**
+ * Sample code: Create/Update Snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createUpdateSnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .createOrUpdateWithResponse(
+ "rg1",
+ "snapshot1",
+ new SnapshotInner()
+ .withLocation("westus")
+ .withTags(mapOf("key1", "val1", "key2", "val2"))
+ .withCreationData(
+ new CreationData()
+ .withSourceResourceId(
+ "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsDeleteSamples.java
new file mode 100644
index 0000000000000..7c90171ccaab3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots Delete. */
+public final class SnapshotsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/SnapshotsDelete.json
+ */
+ /**
+ * Sample code: Delete Snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteSnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .deleteWithResponse("rg1", "snapshot1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..5bc230d021b14
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots GetByResourceGroup. */
+public final class SnapshotsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/SnapshotsGet.json
+ */
+ /**
+ * Sample code: Get Snapshot.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getSnapshot(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..c61e9f9cdcc37
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots ListByResourceGroup. */
+public final class SnapshotsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/SnapshotsListByResourceGroup.json
+ */
+ /**
+ * Sample code: List Snapshots by Resource Group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listSnapshotsByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.kubernetesClusters().manager().serviceClient().getSnapshots().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsListSamples.java
new file mode 100644
index 0000000000000..f422286d73c19
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Snapshots List. */
+public final class SnapshotsListSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/SnapshotsList.json
+ */
+ /**
+ * Sample code: List Snapshots.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listSnapshots(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.kubernetesClusters().manager().serviceClient().getSnapshots().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..79087e32da4cc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerservice/generated/SnapshotsUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerservice.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerservice.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Snapshots UpdateTags. */
+public final class SnapshotsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2021-09-01/examples/SnapshotsUpdateTags.json
+ */
+ /**
+ * Sample code: Update Snapshot Tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateSnapshotTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .kubernetesClusters()
+ .manager()
+ .serviceClient()
+ .getSnapshots()
+ .updateTagsWithResponse(
+ "rg1", "snapshot1", new TagsObject().withTags(mapOf("key2", "new-val2", "key3", "val3")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java
new file mode 100644
index 0000000000000..202e0cc1dab6c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersCreateUpdateSamples.java
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.fluent.models.ClusterResourceInner;
+import com.azure.resourcemanager.cosmos.models.AuthenticationMethod;
+import com.azure.resourcemanager.cosmos.models.Certificate;
+import com.azure.resourcemanager.cosmos.models.ClusterResourceProperties;
+import com.azure.resourcemanager.cosmos.models.SeedNode;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CassandraClusters CreateUpdate. */
+public final class CassandraClustersCreateUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterCreate.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .createUpdate(
+ "cassandra-prod-rg",
+ "cassandra-prod",
+ new ClusterResourceInner()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withProperties(
+ new ClusterResourceProperties()
+ .withDelegatedManagementSubnetId(
+ "/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/management")
+ .withCassandraVersion("3.11")
+ .withClusterNameOverride("ClusterNameIllegalForAzureResource")
+ .withAuthenticationMethod(AuthenticationMethod.CASSANDRA)
+ .withInitialCassandraAdminPassword("mypassword")
+ .withClientCertificates(
+ Arrays
+ .asList(
+ new Certificate()
+ .withPem(
+ "-----BEGIN CERTIFICATE-----\n"
+ + "...Base64 encoded certificate...\n"
+ + "-----END CERTIFICATE-----")))
+ .withExternalGossipCertificates(
+ Arrays
+ .asList(
+ new Certificate()
+ .withPem(
+ "-----BEGIN CERTIFICATE-----\n"
+ + "...Base64 encoded certificate...\n"
+ + "-----END CERTIFICATE-----")))
+ .withExternalSeedNodes(
+ Arrays
+ .asList(
+ new SeedNode().withIpAddress("10.52.221.2"),
+ new SeedNode().withIpAddress("10.52.221.3"),
+ new SeedNode().withIpAddress("10.52.221.4")))
+ .withHoursBetweenBackups(24)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java
new file mode 100644
index 0000000000000..86e7bc7efa328
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters Deallocate. */
+public final class CassandraClustersDeallocateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterDeallocate.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterDeallocate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterDeallocate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .deallocate("cassandra-prod-rg", "cassandra-prod", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java
new file mode 100644
index 0000000000000..d64e6d82a3113
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters Delete. */
+public final class CassandraClustersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterDelete.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .delete("cassandra-prod-rg", "cassandra-prod", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..9bbbf886aa913
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters GetByResourceGroup. */
+public final class CassandraClustersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterGet.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .getByResourceGroupWithResponse("cassandra-prod-rg", "cassandra-prod", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java
new file mode 100644
index 0000000000000..8bf14e8853475
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersInvokeCommandSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CommandPostBody;
+
+/** Samples for CassandraClusters InvokeCommand. */
+public final class CassandraClustersInvokeCommandSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraCommand.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraCommand.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraCommand(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .invokeCommand(
+ "cassandra-prod-rg",
+ "cassandra-prod",
+ new CommandPostBody().withCommand("nodetool status").withHost("10.0.1.12"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..e4a5a796b2136
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters ListByResourceGroup. */
+public final class CassandraClustersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterListByResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .listByResourceGroup("cassandra-prod-rg", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java
new file mode 100644
index 0000000000000..8e6228d7e8764
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters List. */
+public final class CassandraClustersListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterListBySubscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterListBySubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getCassandraClusters().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java
new file mode 100644
index 0000000000000..0e6070126f868
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStartSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters Start. */
+public final class CassandraClustersStartSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterStart.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterStart.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterStart(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .start("cassandra-prod-rg", "cassandra-prod", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java
new file mode 100644
index 0000000000000..98dcd8026d6dc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersStatusSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraClusters Status. */
+public final class CassandraClustersStatusSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraStatus.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraStatus.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraStatus(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .statusWithResponse("cassandra-prod-rg", "cassandra-prod", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java
new file mode 100644
index 0000000000000..4ac563c4ed4a6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersUpdateSamples.java
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.fluent.models.ClusterResourceInner;
+import com.azure.resourcemanager.cosmos.models.AuthenticationMethod;
+import com.azure.resourcemanager.cosmos.models.Certificate;
+import com.azure.resourcemanager.cosmos.models.ClusterResourceProperties;
+import com.azure.resourcemanager.cosmos.models.SeedNode;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CassandraClusters Update. */
+public final class CassandraClustersUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterPatch.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraClusterPatch.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraClusterPatch(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraClusters()
+ .update(
+ "cassandra-prod-rg",
+ "cassandra-prod",
+ new ClusterResourceInner()
+ .withTags(mapOf("owner", "mike"))
+ .withProperties(
+ new ClusterResourceProperties()
+ .withAuthenticationMethod(AuthenticationMethod.NONE)
+ .withExternalGossipCertificates(
+ Arrays
+ .asList(
+ new Certificate()
+ .withPem(
+ "-----BEGIN CERTIFICATE-----\n"
+ + "...Base64 encoded certificate...\n"
+ + "-----END CERTIFICATE-----")))
+ .withExternalSeedNodes(
+ Arrays
+ .asList(
+ new SeedNode().withIpAddress("10.52.221.2"),
+ new SeedNode().withIpAddress("10.52.221.3"),
+ new SeedNode().withIpAddress("10.52.221.4")))
+ .withHoursBetweenBackups(12)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java
new file mode 100644
index 0000000000000..0e91902a439d6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersCreateUpdateSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.fluent.models.DataCenterResourceInner;
+import com.azure.resourcemanager.cosmos.models.DataCenterResourceProperties;
+
+/** Samples for CassandraDataCenters CreateUpdate. */
+public final class CassandraDataCentersCreateUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterCreate.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraDataCenterCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraDataCenterCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraDataCenters()
+ .createUpdate(
+ "cassandra-prod-rg",
+ "cassandra-prod",
+ "dc1",
+ new DataCenterResourceInner()
+ .withProperties(
+ new DataCenterResourceProperties()
+ .withDataCenterLocation("West US 2")
+ .withDelegatedSubnetId(
+ "/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet")
+ .withNodeCount(9)
+ .withBase64EncodedCassandraYamlFragment(
+ "Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA=")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java
new file mode 100644
index 0000000000000..a3e1926cf865a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraDataCenters Delete. */
+public final class CassandraDataCentersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterDelete.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraDataCenterDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraDataCenterDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraDataCenters()
+ .delete("cassandra-prod-rg", "cassandra-prod", "dc1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java
new file mode 100644
index 0000000000000..b7d0e7d9f84a6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraDataCenters Get. */
+public final class CassandraDataCentersGetSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterGet.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraDataCenterGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraDataCenterGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraDataCenters()
+ .getWithResponse("cassandra-prod-rg", "cassandra-prod", "dc1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java
new file mode 100644
index 0000000000000..c5fef359e98ac
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraDataCenters List. */
+public final class CassandraDataCentersListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterList.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraDataCenterList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraDataCenterList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraDataCenters()
+ .list("cassandra-prod-rg", "cassandra-prod", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java
new file mode 100644
index 0000000000000..f6c643bfa182c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraDataCentersUpdateSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.fluent.models.DataCenterResourceInner;
+import com.azure.resourcemanager.cosmos.models.DataCenterResourceProperties;
+
+/** Samples for CassandraDataCenters Update. */
+public final class CassandraDataCentersUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterPatch.json
+ */
+ /**
+ * Sample code: CosmosDBManagedCassandraDataCenterUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBManagedCassandraDataCenterUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraDataCenters()
+ .update(
+ "cassandra-prod-rg",
+ "cassandra-prod",
+ "dc1",
+ new DataCenterResourceInner()
+ .withProperties(
+ new DataCenterResourceProperties()
+ .withDataCenterLocation("West US 2")
+ .withDelegatedSubnetId(
+ "/subscriptions/536e130b-d7d6-4ac7-98a5-de20d69588d2/resourceGroups/customer-vnet-rg/providers/Microsoft.Network/virtualNetworks/customer-vnet/subnets/dc1-subnet")
+ .withNodeCount(9)
+ .withBase64EncodedCassandraYamlFragment(
+ "Y29tcGFjdGlvbl90aHJvdWdocHV0X21iX3Blcl9zZWM6IDMyCmNvbXBhY3Rpb25fbGFyZ2VfcGFydGl0aW9uX3dhcm5pbmdfdGhyZXNob2xkX21iOiAxMDA=")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java
new file mode 100644
index 0000000000000..13729a19440da
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraKeyspaceSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceResource;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CassandraResources CreateUpdateCassandraKeyspace. */
+public final class CassandraResourcesCreateUpdateCassandraKeyspaceSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .createUpdateCassandraKeyspace(
+ "rg1",
+ "ddb1",
+ "keyspaceName",
+ new CassandraKeyspaceCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new CassandraKeyspaceResource().withId("keyspaceName"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java
new file mode 100644
index 0000000000000..fa7556eccaac8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesCreateUpdateCassandraTableSamples.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CassandraPartitionKey;
+import com.azure.resourcemanager.cosmos.models.CassandraSchema;
+import com.azure.resourcemanager.cosmos.models.CassandraTableCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.CassandraTableResource;
+import com.azure.resourcemanager.cosmos.models.ClusterKey;
+import com.azure.resourcemanager.cosmos.models.Column;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CassandraResources CreateUpdateCassandraTable. */
+public final class CassandraResourcesCreateUpdateCassandraTableSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .createUpdateCassandraTable(
+ "rg1",
+ "ddb1",
+ "keyspaceName",
+ "tableName",
+ new CassandraTableCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(
+ new CassandraTableResource()
+ .withId("tableName")
+ .withDefaultTtl(100)
+ .withSchema(
+ new CassandraSchema()
+ .withColumns(Arrays.asList(new Column().withName("columnA").withType("Ascii")))
+ .withPartitionKeys(Arrays.asList(new CassandraPartitionKey().withName("columnA")))
+ .withClusterKeys(
+ Arrays.asList(new ClusterKey().withName("columnA").withOrderBy("Asc")))))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java
new file mode 100644
index 0000000000000..c05658112f500
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraKeyspaceSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources DeleteCassandraKeyspace. */
+public final class CassandraResourcesDeleteCassandraKeyspaceSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceDelete.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .deleteCassandraKeyspace("rg1", "ddb1", "keyspaceName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java
new file mode 100644
index 0000000000000..9676d815323e0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesDeleteCassandraTableSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources DeleteCassandraTable. */
+public final class CassandraResourcesDeleteCassandraTableSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableDelete.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .deleteCassandraTable("rg1", "ddb1", "keyspaceName", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java
new file mode 100644
index 0000000000000..dc91a82d512ba
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources GetCassandraKeyspace. */
+public final class CassandraResourcesGetCassandraKeyspaceSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceGet.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .getCassandraKeyspaceWithResponse("rg1", "ddb1", "keyspaceName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java
new file mode 100644
index 0000000000000..74d1a87b1f907
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraKeyspaceThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources GetCassandraKeyspaceThroughput. */
+public final class CassandraResourcesGetCassandraKeyspaceThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .getCassandraKeyspaceThroughputWithResponse("rg1", "ddb1", "keyspaceName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java
new file mode 100644
index 0000000000000..14e6ec466e004
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources GetCassandraTable. */
+public final class CassandraResourcesGetCassandraTableSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableGet.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .getCassandraTableWithResponse("rg1", "ddb1", "keyspaceName", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java
new file mode 100644
index 0000000000000..0169a00ed4dd4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesGetCassandraTableThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources GetCassandraTableThroughput. */
+public final class CassandraResourcesGetCassandraTableThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .getCassandraTableThroughputWithResponse("rg1", "ddb1", "keyspaceName", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java
new file mode 100644
index 0000000000000..daa33025b0a64
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraKeyspacesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources ListCassandraKeyspaces. */
+public final class CassandraResourcesListCassandraKeyspacesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceList.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .listCassandraKeyspaces("rgName", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java
new file mode 100644
index 0000000000000..7774417298741
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesListCassandraTablesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources ListCassandraTables. */
+public final class CassandraResourcesListCassandraTablesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableList.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .listCassandraTables("rgName", "ddb1", "keyspaceName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java
new file mode 100644
index 0000000000000..4d5703c8cd662
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources MigrateCassandraKeyspaceToAutoscale. */
+public final class CassandraResourcesMigrateCassandraKeyspaceToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceMigrateToAutoscale(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .migrateCassandraKeyspaceToAutoscale("rg1", "ddb1", "keyspaceName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java
new file mode 100644
index 0000000000000..51833bb24aa32
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources MigrateCassandraKeyspaceToManualThroughput. */
+public final class CassandraResourcesMigrateCassandraKeyspaceToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .migrateCassandraKeyspaceToManualThroughput("rg1", "ddb1", "keyspaceName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java
new file mode 100644
index 0000000000000..1579584f8bd83
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources MigrateCassandraTableToAutoscale. */
+public final class CassandraResourcesMigrateCassandraTableToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .migrateCassandraTableToAutoscale("rg1", "ddb1", "keyspaceName", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java
new file mode 100644
index 0000000000000..5b97b576ea344
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesMigrateCassandraTableToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CassandraResources MigrateCassandraTableToManualThroughput. */
+public final class CassandraResourcesMigrateCassandraTableToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .migrateCassandraTableToManualThroughput("rg1", "ddb1", "keyspaceName", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java
new file mode 100644
index 0000000000000..526f90964e281
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraKeyspaceThroughputSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CassandraResources UpdateCassandraKeyspaceThroughput. */
+public final class CassandraResourcesUpdateCassandraKeyspaceThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraKeyspaceThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraKeyspaceThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .updateCassandraKeyspaceThroughput(
+ "rg1",
+ "ddb1",
+ "keyspaceName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java
new file mode 100644
index 0000000000000..92b12f86680c5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraResourcesUpdateCassandraTableThroughputSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CassandraResources UpdateCassandraTableThroughput. */
+public final class CassandraResourcesUpdateCassandraTableThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBCassandraTableThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCassandraTableThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCassandraResources()
+ .updateCassandraTableThroughput(
+ "rg1",
+ "ddb1",
+ "keyspaceName",
+ "tableName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java
new file mode 100644
index 0000000000000..2bef7adb52fea
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricDefinitionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Collection ListMetricDefinitions. */
+public final class CollectionListMetricDefinitionsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionGetMetricDefinitions.json
+ */
+ /**
+ * Sample code: CosmosDBCollectionGetMetricDefinitions.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCollectionGetMetricDefinitions(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollections()
+ .listMetricDefinitions("rg1", "ddb1", "databaseRid", "collectionRid", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java
new file mode 100644
index 0000000000000..131b1d6e045a9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListMetricsSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Collection ListMetrics. */
+public final class CollectionListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBCollectionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCollectionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollections()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "databaseRid",
+ "collectionRid",
+ "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java
new file mode 100644
index 0000000000000..ff5116444cd1c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionListUsagesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Collection ListUsages. */
+public final class CollectionListUsagesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionGetUsages.json
+ */
+ /**
+ * Sample code: CosmosDBCollectionGetUsages.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCollectionGetUsages(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollections()
+ .listUsages("rg1", "ddb1", "databaseRid", "collectionRid", "$filter=name.value eq 'Storage'", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java
new file mode 100644
index 0000000000000..ac939e94b1619
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListMetricsSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CollectionPartition ListMetrics. */
+public final class CollectionPartitionListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionPartitionGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollectionPartitions()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "databaseRid",
+ "collectionRid",
+ "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java
new file mode 100644
index 0000000000000..f177e4e0caa3f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionListUsagesSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CollectionPartition ListUsages. */
+public final class CollectionPartitionListUsagesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionPartitionGetUsages.json
+ */
+ /**
+ * Sample code: CosmosDBCollectionGetUsages.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBCollectionGetUsages(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollectionPartitions()
+ .listUsages(
+ "rg1",
+ "ddb1",
+ "databaseRid",
+ "collectionRid",
+ "$filter=name.value eq 'Partition Storage'",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java
new file mode 100644
index 0000000000000..1137a1c71d18d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionPartitionRegionListMetricsSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CollectionPartitionRegion ListMetrics. */
+public final class CollectionPartitionRegionListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollectionPartitionRegions()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "North Europe",
+ "databaseRid",
+ "collectionRid",
+ "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java
new file mode 100644
index 0000000000000..2aded653fb317
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CollectionRegionListMetricsSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CollectionRegion ListMetrics. */
+public final class CollectionRegionListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRegionCollectionGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBRegionCollectionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRegionCollectionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getCollectionRegions()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "North Europe",
+ "databaseRid",
+ "collectionRid",
+ "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java
new file mode 100644
index 0000000000000..a4d64bc37d272
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountRegionListMetricsSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccountRegion ListMetrics. */
+public final class DatabaseAccountRegionListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccountRegions()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "North Europe",
+ "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java
new file mode 100644
index 0000000000000..12370ee739c67
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCheckNameExistsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts CheckNameExists. */
+public final class DatabaseAccountsCheckNameExistsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountCheckNameExists.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountCheckNameExists.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountCheckNameExists(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .checkNameExistsWithResponse("ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..84f722ae1db38
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsCreateOrUpdateSamples.java
@@ -0,0 +1,222 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.fluent.models.DatabaseRestoreResourceInner;
+import com.azure.resourcemanager.cosmos.models.AnalyticalStorageConfiguration;
+import com.azure.resourcemanager.cosmos.models.AnalyticalStorageSchemaType;
+import com.azure.resourcemanager.cosmos.models.ApiProperties;
+import com.azure.resourcemanager.cosmos.models.BackupStorageRedundancy;
+import com.azure.resourcemanager.cosmos.models.Capacity;
+import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy;
+import com.azure.resourcemanager.cosmos.models.ContinuousModeBackupPolicy;
+import com.azure.resourcemanager.cosmos.models.CorsPolicy;
+import com.azure.resourcemanager.cosmos.models.CreateMode;
+import com.azure.resourcemanager.cosmos.models.DatabaseAccountCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.DatabaseAccountKind;
+import com.azure.resourcemanager.cosmos.models.DefaultConsistencyLevel;
+import com.azure.resourcemanager.cosmos.models.IpAddressOrRange;
+import com.azure.resourcemanager.cosmos.models.Location;
+import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities;
+import com.azure.resourcemanager.cosmos.models.NetworkAclBypass;
+import com.azure.resourcemanager.cosmos.models.PeriodicModeBackupPolicy;
+import com.azure.resourcemanager.cosmos.models.PeriodicModeProperties;
+import com.azure.resourcemanager.cosmos.models.PublicNetworkAccess;
+import com.azure.resourcemanager.cosmos.models.ResourceIdentityType;
+import com.azure.resourcemanager.cosmos.models.RestoreMode;
+import com.azure.resourcemanager.cosmos.models.RestoreParameters;
+import com.azure.resourcemanager.cosmos.models.ServerVersion;
+import com.azure.resourcemanager.cosmos.models.VirtualNetworkRule;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DatabaseAccounts CreateOrUpdate. */
+public final class DatabaseAccountsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBRestoreDatabaseAccountCreateUpdate.json.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestoreDatabaseAccountCreateUpdateJson(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .createOrUpdate(
+ "rg1",
+ "ddb1",
+ new DatabaseAccountCreateUpdateParameters()
+ .withLocation("westus")
+ .withTags(mapOf())
+ .withKind(DatabaseAccountKind.GLOBAL_DOCUMENT_DB)
+ .withConsistencyPolicy(
+ new ConsistencyPolicy()
+ .withDefaultConsistencyLevel(DefaultConsistencyLevel.BOUNDED_STALENESS)
+ .withMaxStalenessPrefix(200L)
+ .withMaxIntervalInSeconds(10))
+ .withLocations(
+ Arrays
+ .asList(
+ new Location()
+ .withLocationName("southcentralus")
+ .withFailoverPriority(0)
+ .withIsZoneRedundant(false)))
+ .withKeyVaultKeyUri("https://myKeyVault.vault.azure.net")
+ .withEnableFreeTier(false)
+ .withApiProperties(new ApiProperties().withServerVersion(ServerVersion.THREE_TWO))
+ .withEnableAnalyticalStorage(true)
+ .withCreateMode(CreateMode.RESTORE)
+ .withBackupPolicy(new ContinuousModeBackupPolicy())
+ .withRestoreParameters(
+ new RestoreParameters()
+ .withRestoreMode(RestoreMode.POINT_IN_TIME)
+ .withRestoreSource(
+ "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc")
+ .withRestoreTimestampInUtc(OffsetDateTime.parse("2021-03-11T22:05:09Z"))
+ .withDatabasesToRestore(
+ Arrays
+ .asList(
+ new DatabaseRestoreResourceInner()
+ .withDatabaseName("db1")
+ .withCollectionNames(Arrays.asList("collection1", "collection2")),
+ new DatabaseRestoreResourceInner()
+ .withDatabaseName("db2")
+ .withCollectionNames(Arrays.asList("collection3", "collection4"))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountCreateMax.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountCreateMax.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountCreateMax(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .createOrUpdate(
+ "rg1",
+ "ddb1",
+ new DatabaseAccountCreateUpdateParameters()
+ .withLocation("westus")
+ .withTags(mapOf())
+ .withKind(DatabaseAccountKind.MONGO_DB)
+ .withIdentity(
+ new ManagedServiceIdentity()
+ .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1",
+ new ManagedServiceIdentityUserAssignedIdentities())))
+ .withConsistencyPolicy(
+ new ConsistencyPolicy()
+ .withDefaultConsistencyLevel(DefaultConsistencyLevel.BOUNDED_STALENESS)
+ .withMaxStalenessPrefix(200L)
+ .withMaxIntervalInSeconds(10))
+ .withLocations(
+ Arrays
+ .asList(
+ new Location()
+ .withLocationName("southcentralus")
+ .withFailoverPriority(0)
+ .withIsZoneRedundant(false),
+ new Location()
+ .withLocationName("eastus")
+ .withFailoverPriority(1)
+ .withIsZoneRedundant(false)))
+ .withIpRules(
+ Arrays
+ .asList(
+ new IpAddressOrRange().withIpAddressOrRange("23.43.230.120"),
+ new IpAddressOrRange().withIpAddressOrRange("110.12.240.0/12")))
+ .withIsVirtualNetworkFilterEnabled(true)
+ .withVirtualNetworkRules(
+ Arrays
+ .asList(
+ new VirtualNetworkRule()
+ .withId(
+ "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")
+ .withIgnoreMissingVNetServiceEndpoint(false)))
+ .withKeyVaultKeyUri("https://myKeyVault.vault.azure.net")
+ .withDefaultIdentity("FirstPartyIdentity")
+ .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
+ .withEnableFreeTier(false)
+ .withApiProperties(new ApiProperties().withServerVersion(ServerVersion.THREE_TWO))
+ .withEnableAnalyticalStorage(true)
+ .withAnalyticalStorageConfiguration(
+ new AnalyticalStorageConfiguration().withSchemaType(AnalyticalStorageSchemaType.WELL_DEFINED))
+ .withCreateMode(CreateMode.DEFAULT)
+ .withBackupPolicy(
+ new PeriodicModeBackupPolicy()
+ .withPeriodicModeProperties(
+ new PeriodicModeProperties()
+ .withBackupIntervalInMinutes(240)
+ .withBackupRetentionIntervalInHours(8)
+ .withBackupStorageRedundancy(BackupStorageRedundancy.GEO)))
+ .withCors(Arrays.asList(new CorsPolicy().withAllowedOrigins("https://test")))
+ .withNetworkAclBypass(NetworkAclBypass.AZURE_SERVICES)
+ .withNetworkAclBypassResourceIds(
+ Arrays
+ .asList(
+ "/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName"))
+ .withCapacity(new Capacity().withTotalThroughputLimit(2000)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountCreateMin.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountCreateMin.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountCreateMin(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .createOrUpdate(
+ "rg1",
+ "ddb1",
+ new DatabaseAccountCreateUpdateParameters()
+ .withLocation("westus")
+ .withLocations(
+ Arrays
+ .asList(
+ new Location()
+ .withLocationName("southcentralus")
+ .withFailoverPriority(0)
+ .withIsZoneRedundant(false)))
+ .withCreateMode(CreateMode.DEFAULT),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java
new file mode 100644
index 0000000000000..f394afe880b11
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts Delete. */
+public final class DatabaseAccountsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountDelete.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getDatabaseAccounts().delete("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java
new file mode 100644
index 0000000000000..b624ac9fb612f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsFailoverPriorityChangeSamples.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.FailoverPolicies;
+import com.azure.resourcemanager.cosmos.models.FailoverPolicy;
+import java.util.Arrays;
+
+/** Samples for DatabaseAccounts FailoverPriorityChange. */
+public final class DatabaseAccountsFailoverPriorityChangeSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountFailoverPriorityChange.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountFailoverPriorityChange(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .failoverPriorityChange(
+ "rg1",
+ "ddb1-failover",
+ new FailoverPolicies()
+ .withFailoverPolicies(
+ Arrays
+ .asList(
+ new FailoverPolicy().withLocationName("eastus").withFailoverPriority(0),
+ new FailoverPolicy().withLocationName("westus").withFailoverPriority(1))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..338467bf5071e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts GetByResourceGroup. */
+public final class DatabaseAccountsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGet.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .getByResourceGroupWithResponse("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java
new file mode 100644
index 0000000000000..57c1448a9ad33
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsGetReadOnlyKeysSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts GetReadOnlyKeys. */
+public final class DatabaseAccountsGetReadOnlyKeysSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountListReadOnlyKeys.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountListReadOnlyKeys(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .getReadOnlyKeysWithResponse("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..3829696b24817
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListByResourceGroup. */
+public final class DatabaseAccountsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountListByResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java
new file mode 100644
index 0000000000000..762636f644230
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListConnectionStringsSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListConnectionStrings. */
+public final class DatabaseAccountsListConnectionStringsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountListConnectionStrings.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountListConnectionStrings(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listConnectionStringsWithResponse("rg1", "ddb1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountListConnectionStringsMongo.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountListConnectionStringsMongo(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listConnectionStringsWithResponse("rg1", "mongo-ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java
new file mode 100644
index 0000000000000..aff7f8f36cddb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListKeysSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListKeys. */
+public final class DatabaseAccountsListKeysSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListKeys.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountListKeys.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountListKeys(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listKeysWithResponse("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java
new file mode 100644
index 0000000000000..e0b7a953c621a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricDefinitionsSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListMetricDefinitions. */
+public final class DatabaseAccountsListMetricDefinitionsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountGetMetricDefinitions.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountGetMetricDefinitions(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listMetricDefinitions("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java
new file mode 100644
index 0000000000000..10f73b375cbaa
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListMetricsSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListMetrics. */
+public final class DatabaseAccountsListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java
new file mode 100644
index 0000000000000..c635142f2630e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListReadOnlyKeysSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListReadOnlyKeys. */
+public final class DatabaseAccountsListReadOnlyKeysSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountListReadOnlyKeys.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountListReadOnlyKeys(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listReadOnlyKeysWithResponse("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java
new file mode 100644
index 0000000000000..04f0051c0bb56
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts List. */
+public final class DatabaseAccountsListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountList.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getDatabaseAccounts().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java
new file mode 100644
index 0000000000000..6900ae25e23ea
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsListUsagesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DatabaseAccounts ListUsages. */
+public final class DatabaseAccountsListUsagesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGetUsages.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountGetUsages.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountGetUsages(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .listUsages("rg1", "ddb1", "$filter=name.value eq 'Storage'", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java
new file mode 100644
index 0000000000000..8d2662009ee01
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOfflineRegionSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.RegionForOnlineOffline;
+
+/** Samples for DatabaseAccounts OfflineRegion. */
+public final class DatabaseAccountsOfflineRegionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountOfflineRegion.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountOfflineRegion.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountOfflineRegion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .offlineRegion("rg1", "ddb1", new RegionForOnlineOffline(), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java
new file mode 100644
index 0000000000000..b1e1d5bacf630
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsOnlineRegionSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.RegionForOnlineOffline;
+
+/** Samples for DatabaseAccounts OnlineRegion. */
+public final class DatabaseAccountsOnlineRegionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountOnlineRegion.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountOnlineRegion.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountOnlineRegion(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .onlineRegion("rg1", "ddb1", new RegionForOnlineOffline(), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java
new file mode 100644
index 0000000000000..7dfdffd6ef3c3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsRegenerateKeySamples.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.DatabaseAccountRegenerateKeyParameters;
+import com.azure.resourcemanager.cosmos.models.KeyKind;
+
+/** Samples for DatabaseAccounts RegenerateKey. */
+public final class DatabaseAccountsRegenerateKeySamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountRegenerateKey.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegenerateKey.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegenerateKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .regenerateKey(
+ "rg1", "ddb1", new DatabaseAccountRegenerateKeyParameters().withKeyKind(KeyKind.PRIMARY), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java
new file mode 100644
index 0000000000000..d223e05f7798d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseAccountsUpdateSamples.java
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.AnalyticalStorageConfiguration;
+import com.azure.resourcemanager.cosmos.models.AnalyticalStorageSchemaType;
+import com.azure.resourcemanager.cosmos.models.BackupStorageRedundancy;
+import com.azure.resourcemanager.cosmos.models.Capacity;
+import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy;
+import com.azure.resourcemanager.cosmos.models.DatabaseAccountUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.DefaultConsistencyLevel;
+import com.azure.resourcemanager.cosmos.models.IpAddressOrRange;
+import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentityUserAssignedIdentities;
+import com.azure.resourcemanager.cosmos.models.NetworkAclBypass;
+import com.azure.resourcemanager.cosmos.models.PeriodicModeBackupPolicy;
+import com.azure.resourcemanager.cosmos.models.PeriodicModeProperties;
+import com.azure.resourcemanager.cosmos.models.ResourceIdentityType;
+import com.azure.resourcemanager.cosmos.models.VirtualNetworkRule;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DatabaseAccounts Update. */
+public final class DatabaseAccountsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountPatch.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountPatch.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountPatch(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabaseAccounts()
+ .update(
+ "rg1",
+ "ddb1",
+ new DatabaseAccountUpdateParameters()
+ .withTags(mapOf("dept", "finance"))
+ .withLocation("westus")
+ .withIdentity(
+ new ManagedServiceIdentity()
+ .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1",
+ new ManagedServiceIdentityUserAssignedIdentities())))
+ .withConsistencyPolicy(
+ new ConsistencyPolicy()
+ .withDefaultConsistencyLevel(DefaultConsistencyLevel.BOUNDED_STALENESS)
+ .withMaxStalenessPrefix(200L)
+ .withMaxIntervalInSeconds(10))
+ .withIpRules(
+ Arrays
+ .asList(
+ new IpAddressOrRange().withIpAddressOrRange("23.43.230.120"),
+ new IpAddressOrRange().withIpAddressOrRange("110.12.240.0/12")))
+ .withIsVirtualNetworkFilterEnabled(true)
+ .withVirtualNetworkRules(
+ Arrays
+ .asList(
+ new VirtualNetworkRule()
+ .withId(
+ "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")
+ .withIgnoreMissingVNetServiceEndpoint(false)))
+ .withDefaultIdentity("FirstPartyIdentity")
+ .withEnableFreeTier(false)
+ .withEnableAnalyticalStorage(true)
+ .withAnalyticalStorageConfiguration(
+ new AnalyticalStorageConfiguration().withSchemaType(AnalyticalStorageSchemaType.WELL_DEFINED))
+ .withBackupPolicy(
+ new PeriodicModeBackupPolicy()
+ .withPeriodicModeProperties(
+ new PeriodicModeProperties()
+ .withBackupIntervalInMinutes(240)
+ .withBackupRetentionIntervalInHours(720)
+ .withBackupStorageRedundancy(BackupStorageRedundancy.LOCAL)))
+ .withNetworkAclBypass(NetworkAclBypass.AZURE_SERVICES)
+ .withNetworkAclBypassResourceIds(
+ Arrays
+ .asList(
+ "/subscriptions/subId/resourcegroups/rgName/providers/Microsoft.Synapse/workspaces/workspaceName"))
+ .withCapacity(new Capacity().withTotalThroughputLimit(2000)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java
new file mode 100644
index 0000000000000..5b0f094d1ccd1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricDefinitionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Database ListMetricDefinitions. */
+public final class DatabaseListMetricDefinitionsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseGetMetricDefinitions.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseGetMetricDefinitions.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseGetMetricDefinitions(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabases()
+ .listMetricDefinitions("rg1", "ddb1", "databaseRid", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java
new file mode 100644
index 0000000000000..0fa4092157201
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListMetricsSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Database ListMetrics. */
+public final class DatabaseListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabases()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "rid",
+ "$filter=(name.value eq 'Total Requests') and timeGrain eq duration'PT5M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java
new file mode 100644
index 0000000000000..ab8f07b98d136
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/DatabaseListUsagesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Database ListUsages. */
+public final class DatabaseListUsagesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseGetUsages.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseGetUsages.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseGetUsages(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getDatabases()
+ .listUsages("rg1", "ddb1", "databaseRid", "$filter=name.value eq 'Storage'", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java
new file mode 100644
index 0000000000000..ae1905b4a2ff4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinDatabaseSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.GremlinDatabaseCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.GremlinDatabaseResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for GremlinResources CreateUpdateGremlinDatabase. */
+public final class GremlinResourcesCreateUpdateGremlinDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .createUpdateGremlinDatabase(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ new GremlinDatabaseCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new GremlinDatabaseResource().withId("databaseName"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java
new file mode 100644
index 0000000000000..f1036bb1f7378
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesCreateUpdateGremlinGraphSamples.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ConflictResolutionMode;
+import com.azure.resourcemanager.cosmos.models.ConflictResolutionPolicy;
+import com.azure.resourcemanager.cosmos.models.ContainerPartitionKey;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.DataType;
+import com.azure.resourcemanager.cosmos.models.GremlinGraphCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.GremlinGraphResource;
+import com.azure.resourcemanager.cosmos.models.IncludedPath;
+import com.azure.resourcemanager.cosmos.models.IndexKind;
+import com.azure.resourcemanager.cosmos.models.Indexes;
+import com.azure.resourcemanager.cosmos.models.IndexingMode;
+import com.azure.resourcemanager.cosmos.models.IndexingPolicy;
+import com.azure.resourcemanager.cosmos.models.PartitionKind;
+import com.azure.resourcemanager.cosmos.models.UniqueKey;
+import com.azure.resourcemanager.cosmos.models.UniqueKeyPolicy;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for GremlinResources CreateUpdateGremlinGraph. */
+public final class GremlinResourcesCreateUpdateGremlinGraphSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .createUpdateGremlinGraph(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "graphName",
+ new GremlinGraphCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(
+ new GremlinGraphResource()
+ .withId("graphName")
+ .withIndexingPolicy(
+ new IndexingPolicy()
+ .withAutomatic(true)
+ .withIndexingMode(IndexingMode.CONSISTENT)
+ .withIncludedPaths(
+ Arrays
+ .asList(
+ new IncludedPath()
+ .withPath("/*")
+ .withIndexes(
+ Arrays
+ .asList(
+ new Indexes()
+ .withDataType(DataType.STRING)
+ .withPrecision(-1)
+ .withKind(IndexKind.RANGE),
+ new Indexes()
+ .withDataType(DataType.NUMBER)
+ .withPrecision(-1)
+ .withKind(IndexKind.RANGE)))))
+ .withExcludedPaths(Arrays.asList()))
+ .withPartitionKey(
+ new ContainerPartitionKey()
+ .withPaths(Arrays.asList("/AccountNumber"))
+ .withKind(PartitionKind.HASH))
+ .withDefaultTtl(100)
+ .withUniqueKeyPolicy(
+ new UniqueKeyPolicy()
+ .withUniqueKeys(
+ Arrays.asList(new UniqueKey().withPaths(Arrays.asList("/testPath")))))
+ .withConflictResolutionPolicy(
+ new ConflictResolutionPolicy()
+ .withMode(ConflictResolutionMode.LAST_WRITER_WINS)
+ .withConflictResolutionPath("/path")))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java
new file mode 100644
index 0000000000000..628cc49c26e7a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinDatabaseSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources DeleteGremlinDatabase. */
+public final class GremlinResourcesDeleteGremlinDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseDelete.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .deleteGremlinDatabase("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java
new file mode 100644
index 0000000000000..ca75ba0dce0d6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesDeleteGremlinGraphSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources DeleteGremlinGraph. */
+public final class GremlinResourcesDeleteGremlinGraphSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphDelete.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .deleteGremlinGraph("rg1", "ddb1", "databaseName", "graphName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java
new file mode 100644
index 0000000000000..e650562d8ad5b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources GetGremlinDatabase. */
+public final class GremlinResourcesGetGremlinDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseGet.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .getGremlinDatabaseWithResponse("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java
new file mode 100644
index 0000000000000..5681b86a0f6af
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinDatabaseThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources GetGremlinDatabaseThroughput. */
+public final class GremlinResourcesGetGremlinDatabaseThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .getGremlinDatabaseThroughputWithResponse("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java
new file mode 100644
index 0000000000000..8c2ace836982f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources GetGremlinGraph. */
+public final class GremlinResourcesGetGremlinGraphSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphGet.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .getGremlinGraphWithResponse("rgName", "ddb1", "databaseName", "graphName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java
new file mode 100644
index 0000000000000..658f23d8f2da9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesGetGremlinGraphThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources GetGremlinGraphThroughput. */
+public final class GremlinResourcesGetGremlinGraphThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .getGremlinGraphThroughputWithResponse("rg1", "ddb1", "databaseName", "graphName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java
new file mode 100644
index 0000000000000..21288fcf065c1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinDatabasesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources ListGremlinDatabases. */
+public final class GremlinResourcesListGremlinDatabasesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseList.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .listGremlinDatabases("rgName", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java
new file mode 100644
index 0000000000000..9f05e0e7ef2d9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesListGremlinGraphsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources ListGremlinGraphs. */
+public final class GremlinResourcesListGremlinGraphsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphList.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .listGremlinGraphs("rgName", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java
new file mode 100644
index 0000000000000..2069e7d82acf9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources MigrateGremlinDatabaseToAutoscale. */
+public final class GremlinResourcesMigrateGremlinDatabaseToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .migrateGremlinDatabaseToAutoscale("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java
new file mode 100644
index 0000000000000..65cf083acc136
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources MigrateGremlinDatabaseToManualThroughput. */
+public final class GremlinResourcesMigrateGremlinDatabaseToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .migrateGremlinDatabaseToManualThroughput("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java
new file mode 100644
index 0000000000000..99cf7e0113320
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources MigrateGremlinGraphToAutoscale. */
+public final class GremlinResourcesMigrateGremlinGraphToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .migrateGremlinGraphToAutoscale("rg1", "ddb1", "databaseName", "graphName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java
new file mode 100644
index 0000000000000..b7569e40c3a63
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesMigrateGremlinGraphToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for GremlinResources MigrateGremlinGraphToManualThroughput. */
+public final class GremlinResourcesMigrateGremlinGraphToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .migrateGremlinGraphToManualThroughput("rg1", "ddb1", "databaseName", "graphName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java
new file mode 100644
index 0000000000000..7df874449da1f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinDatabaseThroughputSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for GremlinResources UpdateGremlinDatabaseThroughput. */
+public final class GremlinResourcesUpdateGremlinDatabaseThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinDatabaseThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinDatabaseThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .updateGremlinDatabaseThroughput(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java
new file mode 100644
index 0000000000000..3bd7a8dc0dfe3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/GremlinResourcesUpdateGremlinGraphThroughputSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for GremlinResources UpdateGremlinGraphThroughput. */
+public final class GremlinResourcesUpdateGremlinGraphThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBGremlinGraphThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBGremlinGraphThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getGremlinResources()
+ .updateGremlinGraphThroughput(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "graphName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java
new file mode 100644
index 0000000000000..7080c6f3ab430
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsGetSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Locations Get. */
+public final class LocationsGetSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBLocationGet.json
+ */
+ /**
+ * Sample code: CosmosDBLocationGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBLocationGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getLocations().getWithResponse("westus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java
new file mode 100644
index 0000000000000..30d693a9eb9c1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/LocationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Locations List. */
+public final class LocationsListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBLocationList.json
+ */
+ /**
+ * Sample code: CosmosDBLocationList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBLocationList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getLocations().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java
new file mode 100644
index 0000000000000..656af204264c0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBCollectionSamples.java
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.MongoDBCollectionCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.MongoDBCollectionResource;
+import com.azure.resourcemanager.cosmos.models.MongoIndex;
+import com.azure.resourcemanager.cosmos.models.MongoIndexKeys;
+import com.azure.resourcemanager.cosmos.models.MongoIndexOptions;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for MongoDBResources CreateUpdateMongoDBCollection. */
+public final class MongoDBResourcesCreateUpdateMongoDBCollectionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .createUpdateMongoDBCollection(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "collectionName",
+ new MongoDBCollectionCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(
+ new MongoDBCollectionResource()
+ .withId("collectionName")
+ .withShardKey(mapOf("testKey", "Hash"))
+ .withIndexes(
+ Arrays
+ .asList(
+ new MongoIndex()
+ .withKey(new MongoIndexKeys().withKeys(Arrays.asList("_ts")))
+ .withOptions(
+ new MongoIndexOptions().withExpireAfterSeconds(100).withUnique(true)),
+ new MongoIndex().withKey(new MongoIndexKeys().withKeys(Arrays.asList("_id"))))))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java
new file mode 100644
index 0000000000000..9a3aabf29354b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesCreateUpdateMongoDBDatabaseSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for MongoDBResources CreateUpdateMongoDBDatabase. */
+public final class MongoDBResourcesCreateUpdateMongoDBDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .createUpdateMongoDBDatabase(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ new MongoDBDatabaseCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new MongoDBDatabaseResource().withId("databaseName"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java
new file mode 100644
index 0000000000000..7ffdddf15aabf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBCollectionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources DeleteMongoDBCollection. */
+public final class MongoDBResourcesDeleteMongoDBCollectionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionDelete.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .deleteMongoDBCollection("rg1", "ddb1", "databaseName", "collectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java
new file mode 100644
index 0000000000000..d35432a28d968
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesDeleteMongoDBDatabaseSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources DeleteMongoDBDatabase. */
+public final class MongoDBResourcesDeleteMongoDBDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseDelete.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .deleteMongoDBDatabase("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java
new file mode 100644
index 0000000000000..96234d19f2609
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources GetMongoDBCollection. */
+public final class MongoDBResourcesGetMongoDBCollectionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionGet.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .getMongoDBCollectionWithResponse("rgName", "ddb1", "databaseName", "collectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java
new file mode 100644
index 0000000000000..47f1d6ca5b833
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources GetMongoDBCollectionThroughput. */
+public final class MongoDBResourcesGetMongoDBCollectionThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .getMongoDBCollectionThroughputWithResponse("rg1", "ddb1", "databaseName", "collectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java
new file mode 100644
index 0000000000000..24c5bb65863ec
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources GetMongoDBDatabase. */
+public final class MongoDBResourcesGetMongoDBDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseGet.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .getMongoDBDatabaseWithResponse("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java
new file mode 100644
index 0000000000000..52ace9d39867a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBDatabaseThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources GetMongoDBDatabaseThroughput. */
+public final class MongoDBResourcesGetMongoDBDatabaseThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .getMongoDBDatabaseThroughputWithResponse("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java
new file mode 100644
index 0000000000000..f877ec746626a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBCollectionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources ListMongoDBCollections. */
+public final class MongoDBResourcesListMongoDBCollectionsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionList.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .listMongoDBCollections("rgName", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java
new file mode 100644
index 0000000000000..2c5d2d419590e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesListMongoDBDatabasesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources ListMongoDBDatabases. */
+public final class MongoDBResourcesListMongoDBDatabasesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseList.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .listMongoDBDatabases("rgName", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java
new file mode 100644
index 0000000000000..f66ee83209658
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources MigrateMongoDBCollectionToAutoscale. */
+public final class MongoDBResourcesMigrateMongoDBCollectionToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionMigrateToAutoscale(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .migrateMongoDBCollectionToAutoscale("rg1", "ddb1", "databaseName", "collectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java
new file mode 100644
index 0000000000000..a6dcffafffb34
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources MigrateMongoDBCollectionToManualThroughput. */
+public final class MongoDBResourcesMigrateMongoDBCollectionToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .migrateMongoDBCollectionToManualThroughput("rg1", "ddb1", "databaseName", "collectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java
new file mode 100644
index 0000000000000..68b02a424c7c2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources MigrateMongoDBDatabaseToAutoscale. */
+public final class MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .migrateMongoDBDatabaseToAutoscale("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java
new file mode 100644
index 0000000000000..a532afe2dc789
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for MongoDBResources MigrateMongoDBDatabaseToManualThroughput. */
+public final class MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .migrateMongoDBDatabaseToManualThroughput("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java
new file mode 100644
index 0000000000000..79eadc5dd0335
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesRetrieveContinuousBackupInformationSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation;
+
+/** Samples for MongoDBResources RetrieveContinuousBackupInformation. */
+public final class MongoDBResourcesRetrieveContinuousBackupInformationSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionBackupInformation.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionBackupInformation.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionBackupInformation(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .retrieveContinuousBackupInformation(
+ "rgName",
+ "ddb1",
+ "databaseName",
+ "collectionName",
+ new ContinuousBackupRestoreLocation().withLocation("North Europe"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java
new file mode 100644
index 0000000000000..8540932042e66
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBCollectionThroughputSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for MongoDBResources UpdateMongoDBCollectionThroughput. */
+public final class MongoDBResourcesUpdateMongoDBCollectionThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBCollectionThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBCollectionThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .updateMongoDBCollectionThroughput(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "collectionName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java
new file mode 100644
index 0000000000000..1e42795966226
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for MongoDBResources UpdateMongoDBDatabaseThroughput. */
+public final class MongoDBResourcesUpdateMongoDBDatabaseThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBMongoDBDatabaseThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBMongoDBDatabaseThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getMongoDBResources()
+ .updateMongoDBDatabaseThroughput(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..e06d34d8c9354
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesCreateOrUpdateSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
+
+/** Samples for NotebookWorkspaces CreateOrUpdate. */
+public final class NotebookWorkspacesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceCreate.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .createOrUpdate(
+ "rg1",
+ "ddb1",
+ NotebookWorkspaceName.DEFAULT,
+ new NotebookWorkspaceCreateUpdateParameters(),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java
new file mode 100644
index 0000000000000..5be5939ff5885
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesDeleteSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
+
+/** Samples for NotebookWorkspaces Delete. */
+public final class NotebookWorkspacesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceDelete.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .delete("rg1", "ddb1", NotebookWorkspaceName.DEFAULT, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java
new file mode 100644
index 0000000000000..41291c91eeab4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
+
+/** Samples for NotebookWorkspaces Get. */
+public final class NotebookWorkspacesGetSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceGet.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .getWithResponse("rg1", "ddb1", NotebookWorkspaceName.DEFAULT, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java
new file mode 100644
index 0000000000000..4d9462fa5ef1b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListByDatabaseAccountSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for NotebookWorkspaces ListByDatabaseAccount. */
+public final class NotebookWorkspacesListByDatabaseAccountSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceList.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .listByDatabaseAccount("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java
new file mode 100644
index 0000000000000..db2bacd31d0b6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesListConnectionInfoSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
+
+/** Samples for NotebookWorkspaces ListConnectionInfo. */
+public final class NotebookWorkspacesListConnectionInfoSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceListConnectionInfo.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceListConnectionInfo(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .listConnectionInfoWithResponse("rg1", "ddb1", NotebookWorkspaceName.DEFAULT, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java
new file mode 100644
index 0000000000000..5730229bb8bc4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesRegenerateAuthTokenSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
+
+/** Samples for NotebookWorkspaces RegenerateAuthToken. */
+public final class NotebookWorkspacesRegenerateAuthTokenSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceRegenerateAuthToken.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceRegenerateAuthToken(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .regenerateAuthToken("rg1", "ddb1", NotebookWorkspaceName.DEFAULT, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java
new file mode 100644
index 0000000000000..389ec8ef38498
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/NotebookWorkspacesStartSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName;
+
+/** Samples for NotebookWorkspaces Start. */
+public final class NotebookWorkspacesStartSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceStart.json
+ */
+ /**
+ * Sample code: CosmosDBNotebookWorkspaceStart.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBNotebookWorkspaceStart(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getNotebookWorkspaces()
+ .start("rg1", "ddb1", NotebookWorkspaceName.DEFAULT, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java
new file mode 100644
index 0000000000000..1c3effc26df63
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/OperationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBOperationsList.json
+ */
+ /**
+ * Sample code: CosmosDBOperationsList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBOperationsList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getOperations().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java
new file mode 100644
index 0000000000000..4f68dbf722298
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdListMetricsSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PartitionKeyRangeId ListMetrics. */
+public final class PartitionKeyRangeIdListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPKeyRangeIdGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPartitionKeyRangeIds()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "databaseRid",
+ "collectionRid",
+ "0",
+ "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java
new file mode 100644
index 0000000000000..fbfda56178827
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PartitionKeyRangeIdRegionListMetricsSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PartitionKeyRangeIdRegion ListMetrics. */
+public final class PartitionKeyRangeIdRegionListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPartitionKeyRangeIdRegions()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "West US",
+ "databaseRid",
+ "collectionRid",
+ "0",
+ "$filter=(name.value eq 'Max RUs Per Second') and timeGrain eq duration'PT1M' and startTime eq"
+ + " '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T23:58:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java
new file mode 100644
index 0000000000000..c3d9719afd3d3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileListMetricsSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Percentile ListMetrics. */
+public final class PercentileListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPercentileGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPercentiles()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and"
+ + " startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java
new file mode 100644
index 0000000000000..9e1b6f4f41210
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileSourceTargetListMetricsSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PercentileSourceTarget ListMetrics. */
+public final class PercentileSourceTargetListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPercentileSourceTargets()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "West Central US",
+ "East US",
+ "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and"
+ + " startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java
new file mode 100644
index 0000000000000..398739d6bb2e2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PercentileTargetListMetricsSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PercentileTarget ListMetrics. */
+public final class PercentileTargetListMetricsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPercentileTargetGetMetrics.json
+ */
+ /**
+ * Sample code: CosmosDBDatabaseAccountRegionGetMetrics.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBDatabaseAccountRegionGetMetrics(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPercentileTargets()
+ .listMetrics(
+ "rg1",
+ "ddb1",
+ "East US",
+ "$filter=(name.value eq 'Probabilistic Bounded Staleness') and timeGrain eq duration'PT5M' and"
+ + " startTime eq '2017-11-19T23:53:55.2780000Z' and endTime eq '2017-11-20T00:13:55.2780000Z",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..e2151d23bba93
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.cosmos.models.PrivateLinkServiceConnectionStateProperty;
+
+/** Samples for PrivateEndpointConnections CreateOrUpdate. */
+public final class PrivateEndpointConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json
+ */
+ /**
+ * Sample code: Approve or reject a private endpoint connection with a given name.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void approveOrRejectAPrivateEndpointConnectionWithAGivenName(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .createOrUpdate(
+ "rg1",
+ "ddb1",
+ "privateEndpointConnectionName",
+ new PrivateEndpointConnectionInner()
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionStateProperty()
+ .withStatus("Approved")
+ .withDescription("Approved by johndoe@contoso.com")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..a94fc96a042f2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsDeleteSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Delete. */
+public final class PrivateEndpointConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionDelete.json
+ */
+ /**
+ * Sample code: Deletes a private endpoint connection with a given name.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deletesAPrivateEndpointConnectionWithAGivenName(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .delete("rg1", "ddb1", "privateEndpointConnectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java
new file mode 100644
index 0000000000000..65ede129593ca
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Get. */
+public final class PrivateEndpointConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionGet.json
+ */
+ /**
+ * Sample code: Gets private endpoint connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getsPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse("rg1", "ddb1", "privateEndpointConnectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java
new file mode 100644
index 0000000000000..b7fb7fbe1d99e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateEndpointConnectionsListByDatabaseAccountSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections ListByDatabaseAccount. */
+public final class PrivateEndpointConnectionsListByDatabaseAccountSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionListGet.json
+ */
+ /**
+ * Sample code: Gets private endpoint connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getsPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .listByDatabaseAccount("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java
new file mode 100644
index 0000000000000..e1853fa446410
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkResources Get. */
+public final class PrivateLinkResourcesGetSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateLinkResourceGet.json
+ */
+ /**
+ * Sample code: Gets private endpoint connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getsPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPrivateLinkResources()
+ .getWithResponse("rg1", "ddb1", "sql", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java
new file mode 100644
index 0000000000000..dd4b6fcf965c2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/PrivateLinkResourcesListByDatabaseAccountSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkResources ListByDatabaseAccount. */
+public final class PrivateLinkResourcesListByDatabaseAccountSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateLinkResourceListGet.json
+ */
+ /**
+ * Sample code: Gets private endpoint connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getsPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getPrivateLinkResources()
+ .listByDatabaseAccount("rg1", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java
new file mode 100644
index 0000000000000..1c7b3da82e3cb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsGetByLocationSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableDatabaseAccounts GetByLocation. */
+public final class RestorableDatabaseAccountsGetByLocationSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableDatabaseAccountGet.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableDatabaseAccountGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableDatabaseAccountGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableDatabaseAccounts()
+ .getByLocationWithResponse("West US", "d9b26648-2f53-4541-b3d8-3044f4f9810d", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java
new file mode 100644
index 0000000000000..3c653b110c956
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListByLocationSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableDatabaseAccounts ListByLocation. */
+public final class RestorableDatabaseAccountsListByLocationSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableDatabaseAccountList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableDatabaseAccountList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableDatabaseAccountList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableDatabaseAccounts()
+ .listByLocation("West US", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java
new file mode 100644
index 0000000000000..b027cc2917932
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableDatabaseAccountsListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableDatabaseAccounts List. */
+public final class RestorableDatabaseAccountsListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableDatabaseAccountNoLocationList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableDatabaseAccountNoLocationList(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.cosmosDBAccounts().manager().serviceClient().getRestorableDatabaseAccounts().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java
new file mode 100644
index 0000000000000..4b3dce5a0fc5c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbCollectionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableMongodbCollections List. */
+public final class RestorableMongodbCollectionsListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableMongodbCollectionList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableMongodbCollectionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableMongodbCollectionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableMongodbCollections()
+ .list("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", "PD5DALigDgw=", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java
new file mode 100644
index 0000000000000..35eeae191b17f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbDatabasesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableMongodbDatabases List. */
+public final class RestorableMongodbDatabasesListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableMongodbDatabaseList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableMongodbDatabaseList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableMongodbDatabaseList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableMongodbDatabases()
+ .list("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java
new file mode 100644
index 0000000000000..265ab47c76489
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableMongodbResourcesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableMongodbResources List. */
+public final class RestorableMongodbResourcesListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableMongodbResourceList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableMongodbResourceList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableMongodbResourceList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableMongodbResources()
+ .list("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", "WestUS", "10/13/2020 4:56", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java
new file mode 100644
index 0000000000000..e37a9e0cb3221
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlContainersListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableSqlContainers List. */
+public final class RestorableSqlContainersListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableSqlContainerList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableSqlContainerList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableSqlContainerList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableSqlContainers()
+ .list("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", "3fu-hg==", null, null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java
new file mode 100644
index 0000000000000..9e9ef45ebbe46
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlDatabasesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableSqlDatabases List. */
+public final class RestorableSqlDatabasesListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableSqlDatabaseList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableSqlDatabaseList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableSqlDatabaseList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableSqlDatabases()
+ .list("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java
new file mode 100644
index 0000000000000..1d89b0a4e41db
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/RestorableSqlResourcesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for RestorableSqlResources List. */
+public final class RestorableSqlResourcesListSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableSqlResourceList.json
+ */
+ /**
+ * Sample code: CosmosDBRestorableSqlResourceList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBRestorableSqlResourceList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getRestorableSqlResources()
+ .list("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", "WestUS", "10/13/2020 4:56", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java
new file mode 100644
index 0000000000000..21a084663f0d4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlContainerSamples.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ConflictResolutionMode;
+import com.azure.resourcemanager.cosmos.models.ConflictResolutionPolicy;
+import com.azure.resourcemanager.cosmos.models.ContainerPartitionKey;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.DataType;
+import com.azure.resourcemanager.cosmos.models.IncludedPath;
+import com.azure.resourcemanager.cosmos.models.IndexKind;
+import com.azure.resourcemanager.cosmos.models.Indexes;
+import com.azure.resourcemanager.cosmos.models.IndexingMode;
+import com.azure.resourcemanager.cosmos.models.IndexingPolicy;
+import com.azure.resourcemanager.cosmos.models.PartitionKind;
+import com.azure.resourcemanager.cosmos.models.SqlContainerCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.SqlContainerResource;
+import com.azure.resourcemanager.cosmos.models.UniqueKey;
+import com.azure.resourcemanager.cosmos.models.UniqueKeyPolicy;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SqlResources CreateUpdateSqlContainer. */
+public final class SqlResourcesCreateUpdateSqlContainerSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlContainer(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "containerName",
+ new SqlContainerCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(
+ new SqlContainerResource()
+ .withId("containerName")
+ .withIndexingPolicy(
+ new IndexingPolicy()
+ .withAutomatic(true)
+ .withIndexingMode(IndexingMode.CONSISTENT)
+ .withIncludedPaths(
+ Arrays
+ .asList(
+ new IncludedPath()
+ .withPath("/*")
+ .withIndexes(
+ Arrays
+ .asList(
+ new Indexes()
+ .withDataType(DataType.STRING)
+ .withPrecision(-1)
+ .withKind(IndexKind.RANGE),
+ new Indexes()
+ .withDataType(DataType.NUMBER)
+ .withPrecision(-1)
+ .withKind(IndexKind.RANGE)))))
+ .withExcludedPaths(Arrays.asList()))
+ .withPartitionKey(
+ new ContainerPartitionKey()
+ .withPaths(Arrays.asList("/AccountNumber"))
+ .withKind(PartitionKind.HASH))
+ .withDefaultTtl(100)
+ .withUniqueKeyPolicy(
+ new UniqueKeyPolicy()
+ .withUniqueKeys(
+ Arrays.asList(new UniqueKey().withPaths(Arrays.asList("/testPath")))))
+ .withConflictResolutionPolicy(
+ new ConflictResolutionPolicy()
+ .withMode(ConflictResolutionMode.LAST_WRITER_WINS)
+ .withConflictResolutionPath("/path")))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java
new file mode 100644
index 0000000000000..78cb7befb90a4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlDatabaseSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.SqlDatabaseCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.SqlDatabaseResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SqlResources CreateUpdateSqlDatabase. */
+public final class SqlResourcesCreateUpdateSqlDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlDatabase(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ new SqlDatabaseCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new SqlDatabaseResource().withId("databaseName"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java
new file mode 100644
index 0000000000000..5d05e7604c0d9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleAssignmentSamples.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.SqlRoleAssignmentCreateUpdateParameters;
+
+/** Samples for SqlResources CreateUpdateSqlRoleAssignment. */
+public final class SqlResourcesCreateUpdateSqlRoleAssignmentSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleAssignmentCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleAssignmentCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlRoleAssignment(
+ "myRoleAssignmentId",
+ "myResourceGroupName",
+ "myAccountName",
+ new SqlRoleAssignmentCreateUpdateParameters()
+ .withRoleDefinitionId(
+ "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/sqlRoleDefinitions/myRoleDefinitionId")
+ .withScope(
+ "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases")
+ .withPrincipalId("myPrincipalId"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java
new file mode 100644
index 0000000000000..d4cb5442bd354
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlRoleDefinitionSamples.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.Permission;
+import com.azure.resourcemanager.cosmos.models.RoleDefinitionType;
+import com.azure.resourcemanager.cosmos.models.SqlRoleDefinitionCreateUpdateParameters;
+import java.util.Arrays;
+
+/** Samples for SqlResources CreateUpdateSqlRoleDefinition. */
+public final class SqlResourcesCreateUpdateSqlRoleDefinitionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleDefinitionCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleDefinitionCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlRoleDefinition(
+ "myRoleDefinitionId",
+ "myResourceGroupName",
+ "myAccountName",
+ new SqlRoleDefinitionCreateUpdateParameters()
+ .withRoleName("myRoleName")
+ .withType(RoleDefinitionType.CUSTOM_ROLE)
+ .withAssignableScopes(
+ Arrays
+ .asList(
+ "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales",
+ "/subscriptions/mySubscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases"))
+ .withPermissions(
+ Arrays
+ .asList(
+ new Permission()
+ .withDataActions(
+ Arrays
+ .asList(
+ "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create",
+ "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"))
+ .withNotDataActions(Arrays.asList()))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java
new file mode 100644
index 0000000000000..8a3033c823e41
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlStoredProcedureSamples.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.SqlStoredProcedureCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.SqlStoredProcedureResource;
+
+/** Samples for SqlResources CreateUpdateSqlStoredProcedure. */
+public final class SqlResourcesCreateUpdateSqlStoredProcedureSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlStoredProcedureCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlStoredProcedureCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlStoredProcedure(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "containerName",
+ "storedProcedureName",
+ new SqlStoredProcedureCreateUpdateParameters()
+ .withResource(new SqlStoredProcedureResource().withId("storedProcedureName").withBody("body"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java
new file mode 100644
index 0000000000000..dbbd88598dcbd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlTriggerSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.SqlTriggerCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.SqlTriggerResource;
+import com.azure.resourcemanager.cosmos.models.TriggerOperation;
+import com.azure.resourcemanager.cosmos.models.TriggerType;
+
+/** Samples for SqlResources CreateUpdateSqlTrigger. */
+public final class SqlResourcesCreateUpdateSqlTriggerSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlTriggerCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlTriggerCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlTriggerCreateUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlTrigger(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "containerName",
+ "triggerName",
+ new SqlTriggerCreateUpdateParameters()
+ .withResource(
+ new SqlTriggerResource()
+ .withId("triggerName")
+ .withBody("body")
+ .withTriggerType(TriggerType.fromString("triggerType"))
+ .withTriggerOperation(TriggerOperation.fromString("triggerOperation")))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java
new file mode 100644
index 0000000000000..316bb917a4a3d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.SqlUserDefinedFunctionCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.SqlUserDefinedFunctionResource;
+
+/** Samples for SqlResources CreateUpdateSqlUserDefinedFunction. */
+public final class SqlResourcesCreateUpdateSqlUserDefinedFunctionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlUserDefinedFunctionCreateUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlUserDefinedFunctionCreateUpdate(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .createUpdateSqlUserDefinedFunction(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "containerName",
+ "userDefinedFunctionName",
+ new SqlUserDefinedFunctionCreateUpdateParameters()
+ .withResource(
+ new SqlUserDefinedFunctionResource().withId("userDefinedFunctionName").withBody("body"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java
new file mode 100644
index 0000000000000..0897a8968f102
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlContainerSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlContainer. */
+public final class SqlResourcesDeleteSqlContainerSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlContainer("rg1", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java
new file mode 100644
index 0000000000000..6f1802927dccf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlDatabaseSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlDatabase. */
+public final class SqlResourcesDeleteSqlDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlDatabase("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java
new file mode 100644
index 0000000000000..3a5ab24b1f592
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleAssignmentSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlRoleAssignment. */
+public final class SqlResourcesDeleteSqlRoleAssignmentSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleAssignmentDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleAssignmentDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleAssignmentDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlRoleAssignment("myRoleAssignmentId", "myResourceGroupName", "myAccountName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java
new file mode 100644
index 0000000000000..a1910f4a5816a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlRoleDefinitionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlRoleDefinition. */
+public final class SqlResourcesDeleteSqlRoleDefinitionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleDefinitionDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleDefinitionDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleDefinitionDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlRoleDefinition("myRoleDefinitionId", "myResourceGroupName", "myAccountName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java
new file mode 100644
index 0000000000000..3f80d43d4f068
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlStoredProcedureSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlStoredProcedure. */
+public final class SqlResourcesDeleteSqlStoredProcedureSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlStoredProcedureDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlStoredProcedureDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlStoredProcedureDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlStoredProcedure(
+ "rg1", "ddb1", "databaseName", "containerName", "storedProcedureName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java
new file mode 100644
index 0000000000000..95eecb26a65a4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlTriggerSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlTrigger. */
+public final class SqlResourcesDeleteSqlTriggerSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlTriggerDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlTriggerDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlTriggerDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlTrigger("rg1", "ddb1", "databaseName", "containerName", "triggerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java
new file mode 100644
index 0000000000000..f268247fdb0bb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesDeleteSqlUserDefinedFunctionSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources DeleteSqlUserDefinedFunction. */
+public final class SqlResourcesDeleteSqlUserDefinedFunctionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json
+ */
+ /**
+ * Sample code: CosmosDBSqlUserDefinedFunctionDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlUserDefinedFunctionDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .deleteSqlUserDefinedFunction(
+ "rg1", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java
new file mode 100644
index 0000000000000..34e870192e98f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlContainer. */
+public final class SqlResourcesGetSqlContainerSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlContainerWithResponse("rgName", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java
new file mode 100644
index 0000000000000..e858701e9b3eb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlContainerThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlContainerThroughput. */
+public final class SqlResourcesGetSqlContainerThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlContainerThroughputWithResponse("rg1", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java
new file mode 100644
index 0000000000000..ab3d9877ae786
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlDatabase. */
+public final class SqlResourcesGetSqlDatabaseSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlDatabaseWithResponse("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java
new file mode 100644
index 0000000000000..d436005cb78d5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlDatabaseThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlDatabaseThroughput. */
+public final class SqlResourcesGetSqlDatabaseThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlDatabaseThroughputWithResponse("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java
new file mode 100644
index 0000000000000..dc0a5b79f13b7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleAssignmentSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlRoleAssignment. */
+public final class SqlResourcesGetSqlRoleAssignmentSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleAssignmentGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleAssignmentGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleAssignmentGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlRoleAssignmentWithResponse(
+ "myRoleAssignmentId", "myResourceGroupName", "myAccountName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java
new file mode 100644
index 0000000000000..775cad09cefd1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlRoleDefinitionSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlRoleDefinition. */
+public final class SqlResourcesGetSqlRoleDefinitionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleDefinitionGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleDefinitionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleDefinitionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlRoleDefinitionWithResponse(
+ "myRoleDefinitionId", "myResourceGroupName", "myAccountName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java
new file mode 100644
index 0000000000000..7b27745cd94ea
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlStoredProcedureSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlStoredProcedure. */
+public final class SqlResourcesGetSqlStoredProcedureSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlStoredProcedureGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlStoredProcedureGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlStoredProcedureGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlStoredProcedureWithResponse(
+ "rgName", "ddb1", "databaseName", "containerName", "storedProcedureName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java
new file mode 100644
index 0000000000000..2faef22116650
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlTriggerSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlTrigger. */
+public final class SqlResourcesGetSqlTriggerSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlTriggerGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlTriggerGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlTriggerGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlTriggerWithResponse("rgName", "ddb1", "databaseName", "containerName", "triggerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java
new file mode 100644
index 0000000000000..93e63733e0402
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesGetSqlUserDefinedFunctionSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources GetSqlUserDefinedFunction. */
+public final class SqlResourcesGetSqlUserDefinedFunctionSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlUserDefinedFunctionGet.json
+ */
+ /**
+ * Sample code: CosmosDBSqlUserDefinedFunctionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlUserDefinedFunctionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .getSqlUserDefinedFunctionWithResponse(
+ "rgName", "ddb1", "databaseName", "containerName", "userDefinedFunctionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java
new file mode 100644
index 0000000000000..b25dd5a17cc20
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlContainersSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlContainers. */
+public final class SqlResourcesListSqlContainersSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlContainers("rgName", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java
new file mode 100644
index 0000000000000..657962d7af010
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlDatabasesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlDatabases. */
+public final class SqlResourcesListSqlDatabasesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlDatabases("rgName", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java
new file mode 100644
index 0000000000000..2e96ac27676c4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleAssignmentsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlRoleAssignments. */
+public final class SqlResourcesListSqlRoleAssignmentsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleAssignmentList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleAssignmentList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleAssignmentList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlRoleAssignments("myResourceGroupName", "myAccountName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java
new file mode 100644
index 0000000000000..9bbfc11bbee38
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlRoleDefinitionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlRoleDefinitions. */
+public final class SqlResourcesListSqlRoleDefinitionsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlRoleDefinitionList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlRoleDefinitionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlRoleDefinitionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlRoleDefinitions("myResourceGroupName", "myAccountName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java
new file mode 100644
index 0000000000000..651ff0149b838
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlStoredProceduresSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlStoredProcedures. */
+public final class SqlResourcesListSqlStoredProceduresSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlStoredProcedureList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlStoredProcedureList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlStoredProcedureList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlStoredProcedures("rgName", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java
new file mode 100644
index 0000000000000..39e8387a4534c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlTriggersSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlTriggers. */
+public final class SqlResourcesListSqlTriggersSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlTriggerList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlTriggerList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlTriggerList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlTriggers("rgName", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java
new file mode 100644
index 0000000000000..6da3ab3257836
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesListSqlUserDefinedFunctionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources ListSqlUserDefinedFunctions. */
+public final class SqlResourcesListSqlUserDefinedFunctionsSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlUserDefinedFunctionList.json
+ */
+ /**
+ * Sample code: CosmosDBSqlUserDefinedFunctionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlUserDefinedFunctionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .listSqlUserDefinedFunctions("rgName", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java
new file mode 100644
index 0000000000000..9b9ac5af345b5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources MigrateSqlContainerToAutoscale. */
+public final class SqlResourcesMigrateSqlContainerToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .migrateSqlContainerToAutoscale("rg1", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java
new file mode 100644
index 0000000000000..0028579213b65
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlContainerToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources MigrateSqlContainerToManualThroughput. */
+public final class SqlResourcesMigrateSqlContainerToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .migrateSqlContainerToManualThroughput("rg1", "ddb1", "databaseName", "containerName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java
new file mode 100644
index 0000000000000..d7c616c23d6af
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources MigrateSqlDatabaseToAutoscale. */
+public final class SqlResourcesMigrateSqlDatabaseToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .migrateSqlDatabaseToAutoscale("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java
new file mode 100644
index 0000000000000..59270c0eb9679
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesMigrateSqlDatabaseToManualThroughputSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SqlResources MigrateSqlDatabaseToManualThroughput. */
+public final class SqlResourcesMigrateSqlDatabaseToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseMigrateToManualThroughput(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .migrateSqlDatabaseToManualThroughput("rg1", "ddb1", "databaseName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java
new file mode 100644
index 0000000000000..503eba222c364
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesRetrieveContinuousBackupInformationSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation;
+
+/** Samples for SqlResources RetrieveContinuousBackupInformation. */
+public final class SqlResourcesRetrieveContinuousBackupInformationSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerBackupInformation.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerBackupInformation.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerBackupInformation(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .retrieveContinuousBackupInformation(
+ "rgName",
+ "ddb1",
+ "databaseName",
+ "containerName",
+ new ContinuousBackupRestoreLocation().withLocation("North Europe"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java
new file mode 100644
index 0000000000000..bd9ad53961637
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlContainerThroughputSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SqlResources UpdateSqlContainerThroughput. */
+public final class SqlResourcesUpdateSqlContainerThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlContainerThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlContainerThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .updateSqlContainerThroughput(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ "containerName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java
new file mode 100644
index 0000000000000..aef98fbed9ac8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/SqlResourcesUpdateSqlDatabaseThroughputSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SqlResources UpdateSqlDatabaseThroughput. */
+public final class SqlResourcesUpdateSqlDatabaseThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBSqlDatabaseThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBSqlDatabaseThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getSqlResources()
+ .updateSqlDatabaseThroughput(
+ "rg1",
+ "ddb1",
+ "databaseName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java
new file mode 100644
index 0000000000000..a44933dda2cde
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesCreateUpdateTableSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions;
+import com.azure.resourcemanager.cosmos.models.TableCreateUpdateParameters;
+import com.azure.resourcemanager.cosmos.models.TableResource;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for TableResources CreateUpdateTable. */
+public final class TableResourcesCreateUpdateTableSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableCreateUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBTableReplace.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableReplace(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .createUpdateTable(
+ "rg1",
+ "ddb1",
+ "tableName",
+ new TableCreateUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new TableResource().withId("tableName"))
+ .withOptions(new CreateUpdateOptions()),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java
new file mode 100644
index 0000000000000..e9172a11199c6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesDeleteTableSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TableResources DeleteTable. */
+public final class TableResourcesDeleteTableSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableDelete.json
+ */
+ /**
+ * Sample code: CosmosDBTableDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .deleteTable("rg1", "ddb1", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java
new file mode 100644
index 0000000000000..9b8648869623c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TableResources GetTable. */
+public final class TableResourcesGetTableSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableGet.json
+ */
+ /**
+ * Sample code: CosmosDBTableGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .getTableWithResponse("rg1", "ddb1", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java
new file mode 100644
index 0000000000000..c82a922ddfcf8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesGetTableThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TableResources GetTableThroughput. */
+public final class TableResourcesGetTableThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableThroughputGet.json
+ */
+ /**
+ * Sample code: CosmosDBTableThroughputGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableThroughputGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .getTableThroughputWithResponse("rg1", "ddb1", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java
new file mode 100644
index 0000000000000..9dcf2bb49e22b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesListTablesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TableResources ListTables. */
+public final class TableResourcesListTablesSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableList.json
+ */
+ /**
+ * Sample code: CosmosDBTableList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .listTables("rgName", "ddb1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java
new file mode 100644
index 0000000000000..c0bf13240bac1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToAutoscaleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TableResources MigrateTableToAutoscale. */
+public final class TableResourcesMigrateTableToAutoscaleSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableMigrateToAutoscale.json
+ */
+ /**
+ * Sample code: CosmosDBTableMigrateToAutoscale.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableMigrateToAutoscale(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .migrateTableToAutoscale("rg1", "ddb1", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java
new file mode 100644
index 0000000000000..445a786694ca0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesMigrateTableToManualThroughputSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for TableResources MigrateTableToManualThroughput. */
+public final class TableResourcesMigrateTableToManualThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableMigrateToManualThroughput.json
+ */
+ /**
+ * Sample code: CosmosDBTableMigrateToManualThroughput.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableMigrateToManualThroughput(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .migrateTableToManualThroughput("rg1", "ddb1", "tableName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java
new file mode 100644
index 0000000000000..e6945074160b3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/TableResourcesUpdateTableThroughputSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.cosmos.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsResource;
+import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for TableResources UpdateTableThroughput. */
+public final class TableResourcesUpdateTableThroughputSamples {
+ /*
+ * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableThroughputUpdate.json
+ */
+ /**
+ * Sample code: CosmosDBTableThroughputUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void cosmosDBTableThroughputUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .cosmosDBAccounts()
+ .manager()
+ .serviceClient()
+ .getTableResources()
+ .updateTableThroughput(
+ "rg1",
+ "ddb1",
+ "tableName",
+ new ThroughputSettingsUpdateParameters()
+ .withLocation("West US")
+ .withTags(mapOf())
+ .withResource(new ThroughputSettingsResource().withThroughput(400)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..03a5e784dc8e3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersCreateOrUpdateSamples.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.ClusterInner;
+import com.azure.resourcemanager.eventhubs.models.ClusterSku;
+import com.azure.resourcemanager.eventhubs.models.ClusterSkuName;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Clusters CreateOrUpdate. */
+public final class ClustersCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPut.json
+ */
+ /**
+ * Sample code: ClusterPut.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clusterPut(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getClusters()
+ .createOrUpdate(
+ "myResourceGroup",
+ "testCluster",
+ new ClusterInner()
+ .withLocation("South Central US")
+ .withTags(mapOf("tag1", "value1", "tag2", "value2"))
+ .withSku(new ClusterSku().withName(ClusterSkuName.DEDICATED).withCapacity(1)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersDeleteSamples.java
new file mode 100644
index 0000000000000..7b2bc33df9931
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Clusters Delete. */
+public final class ClustersDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterDelete.json
+ */
+ /**
+ * Sample code: ClusterDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clusterDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getClusters()
+ .delete("myResourceGroup", "testCluster", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..b85291b251844
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Clusters GetByResourceGroup. */
+public final class ClustersGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterGet.json
+ */
+ /**
+ * Sample code: ClusterGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clusterGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getClusters()
+ .getByResourceGroupWithResponse("myResourceGroup", "testCluster", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListAvailableClusterRegionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListAvailableClusterRegionSamples.java
new file mode 100644
index 0000000000000..18318e357a676
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListAvailableClusterRegionSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Clusters ListAvailableClusterRegion. */
+public final class ClustersListAvailableClusterRegionSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListAvailableClustersGet.json
+ */
+ /**
+ * Sample code: ListAvailableClusters.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAvailableClusters(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.eventHubs().manager().serviceClient().getClusters().listAvailableClusterRegionWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..aaee4f7b7eae1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Clusters ListByResourceGroup. */
+public final class ClustersListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListByResourceGroup.json
+ */
+ /**
+ * Sample code: ClustersListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clustersListByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.eventHubs().manager().serviceClient().getClusters().listByResourceGroup("myResourceGroup", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListNamespacesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListNamespacesSamples.java
new file mode 100644
index 0000000000000..8d93a2d89b00e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListNamespacesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Clusters ListNamespaces. */
+public final class ClustersListNamespacesSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListNamespacesInClusterGet.json
+ */
+ /**
+ * Sample code: ListNamespacesInCluster.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listNamespacesInCluster(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getClusters()
+ .listNamespacesWithResponse("myResourceGroup", "testCluster", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListSamples.java
new file mode 100644
index 0000000000000..e3f4f7cc4ec51
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Clusters List. */
+public final class ClustersListSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListBySubscription.json
+ */
+ /**
+ * Sample code: ClustersListBySubscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clustersListBySubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.eventHubs().manager().serviceClient().getClusters().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersUpdateSamples.java
new file mode 100644
index 0000000000000..9f74d0727838a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ClustersUpdateSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.ClusterInner;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Clusters Update. */
+public final class ClustersUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPatch.json
+ */
+ /**
+ * Sample code: ClusterPatch.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clusterPatch(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getClusters()
+ .update(
+ "myResourceGroup",
+ "testCluster",
+ new ClusterInner().withLocation("South Central US").withTags(mapOf("tag3", "value3", "tag4", "value4")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConfigurationGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConfigurationGetSamples.java
new file mode 100644
index 0000000000000..c659bc9cf7596
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConfigurationGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Configuration Get. */
+public final class ConfigurationGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationGet.json
+ */
+ /**
+ * Sample code: ClustersQuotasConfigurationGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clustersQuotasConfigurationGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getConfigurations()
+ .getWithResponse("myResourceGroup", "testCluster", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConfigurationPatchSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConfigurationPatchSamples.java
new file mode 100644
index 0000000000000..f335678627a1b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConfigurationPatchSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.ClusterQuotaConfigurationPropertiesInner;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Configuration Patch. */
+public final class ConfigurationPatchSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationPatch.json
+ */
+ /**
+ * Sample code: ClustersQuotasConfigurationPatch.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void clustersQuotasConfigurationPatch(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getConfigurations()
+ .patchWithResponse(
+ "ArunMonocle",
+ "testCluster",
+ new ClusterQuotaConfigurationPropertiesInner()
+ .withSettings(mapOf("eventhub-per-namespace-quota", "20", "namespaces-per-cluster-quota", "200")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..1d9a0a9309525
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsCreateOrUpdateSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.ConsumerGroupInner;
+
+/** Samples for ConsumerGroups CreateOrUpdate. */
+public final class ConsumerGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupCreate.json
+ */
+ /**
+ * Sample code: ConsumerGroupCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void consumerGroupCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getConsumerGroups()
+ .createOrUpdateWithResponse(
+ "ArunMonocle",
+ "sdk-Namespace-2661",
+ "sdk-EventHub-6681",
+ "sdk-ConsumerGroup-5563",
+ new ConsumerGroupInner().withUserMetadata("New consumergroup"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsDeleteSamples.java
new file mode 100644
index 0000000000000..ca514ea334d14
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsDeleteSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConsumerGroups Delete. */
+public final class ConsumerGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupDelete.json
+ */
+ /**
+ * Sample code: ConsumerGroupDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void consumerGroupDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getConsumerGroups()
+ .deleteWithResponse(
+ "ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", "sdk-ConsumerGroup-5563", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsGetSamples.java
new file mode 100644
index 0000000000000..876be9aff82d7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConsumerGroups Get. */
+public final class ConsumerGroupsGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupGet.json
+ */
+ /**
+ * Sample code: ConsumerGroupGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void consumerGroupGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getConsumerGroups()
+ .getWithResponse(
+ "ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", "sdk-ConsumerGroup-5563", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsListByEventHubSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsListByEventHubSamples.java
new file mode 100644
index 0000000000000..8f410d0dfc2f2
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/ConsumerGroupsListByEventHubSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConsumerGroups ListByEventHub. */
+public final class ConsumerGroupsListByEventHubSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupListByEventHub.json
+ */
+ /**
+ * Sample code: ConsumerGroupsListAll.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void consumerGroupsListAll(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getConsumerGroups()
+ .listByEventHub("ArunMonocle", "sdk-Namespace-2661", "sdk-EventHub-6681", null, null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsBreakPairingSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsBreakPairingSamples.java
new file mode 100644
index 0000000000000..02b093473b38a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsBreakPairingSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs BreakPairing. */
+public final class DisasterRecoveryConfigsBreakPairingSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasBreakPairing.json
+ */
+ /**
+ * Sample code: EHAliasBreakPairing.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHAliasBreakPairing(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .breakPairingWithResponse(
+ "exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java
new file mode 100644
index 0000000000000..0be2abc6dcff0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsCheckNameAvailabilitySamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter;
+
+/** Samples for DisasterRecoveryConfigs CheckNameAvailability. */
+public final class DisasterRecoveryConfigsCheckNameAvailabilitySamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCheckNameAvailability.json
+ */
+ /**
+ * Sample code: NamespacesCheckNameAvailability.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void namespacesCheckNameAvailability(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .checkNameAvailabilityWithResponse(
+ "exampleResourceGroup",
+ "sdk-Namespace-9080",
+ new CheckNameAvailabilityParameter().withName("sdk-DisasterRecovery-9474"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..67b48f49f117b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsCreateOrUpdateSamples.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.ArmDisasterRecoveryInner;
+
+/** Samples for DisasterRecoveryConfigs CreateOrUpdate. */
+public final class DisasterRecoveryConfigsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCreate.json
+ */
+ /**
+ * Sample code: EHAliasCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHAliasCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .createOrUpdateWithResponse(
+ "exampleResourceGroup",
+ "sdk-Namespace-8859",
+ "sdk-DisasterRecovery-3814",
+ new ArmDisasterRecoveryInner().withPartnerNamespace("sdk-Namespace-37"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsDeleteSamples.java
new file mode 100644
index 0000000000000..cb216cdc0f463
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsDeleteSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs Delete. */
+public final class DisasterRecoveryConfigsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasDelete.json
+ */
+ /**
+ * Sample code: EHAliasDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHAliasDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .deleteWithResponse(
+ "exampleResourceGroup", "sdk-Namespace-5849", "sdk-DisasterRecovery-3814", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsFailOverSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsFailOverSamples.java
new file mode 100644
index 0000000000000..e976d07d09339
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsFailOverSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs FailOver. */
+public final class DisasterRecoveryConfigsFailOverSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasFailOver.json
+ */
+ /**
+ * Sample code: EHAliasFailOver.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHAliasFailOver(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .failOverWithResponse(
+ "exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..181033a0a25f7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsGetAuthorizationRuleSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs GetAuthorizationRule. */
+public final class DisasterRecoveryConfigsGetAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleGet.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .getAuthorizationRuleWithResponse(
+ "exampleResourceGroup",
+ "sdk-Namespace-9080",
+ "sdk-DisasterRecovery-4879",
+ "sdk-Authrules-4879",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsGetSamples.java
new file mode 100644
index 0000000000000..e59c12b246894
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs Get. */
+public final class DisasterRecoveryConfigsGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasGet.json
+ */
+ /**
+ * Sample code: EHAliasGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHAliasGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .getWithResponse("exampleResourceGroup", "sdk-Namespace-8859", "sdk-DisasterRecovery-3814", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java
new file mode 100644
index 0000000000000..29e9b57e62932
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListAuthorizationRulesSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs ListAuthorizationRules. */
+public final class DisasterRecoveryConfigsListAuthorizationRulesSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListAll.json
+ */
+ /**
+ * Sample code: ListAuthorizationRules.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAuthorizationRules(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .listAuthorizationRules(
+ "exampleResourceGroup", "sdk-Namespace-9080", "sdk-DisasterRecovery-4047", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListKeysSamples.java
new file mode 100644
index 0000000000000..7ea887de757e6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListKeysSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs ListKeys. */
+public final class DisasterRecoveryConfigsListKeysSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListKey.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleListKey.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleListKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .listKeysWithResponse(
+ "exampleResourceGroup",
+ "sdk-Namespace-2702",
+ "sdk-DisasterRecovery-4047",
+ "sdk-Authrules-1746",
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListSamples.java
new file mode 100644
index 0000000000000..0bc4618e7417a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/DisasterRecoveryConfigsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DisasterRecoveryConfigs List. */
+public final class DisasterRecoveryConfigsListSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasList.json
+ */
+ /**
+ * Sample code: EHAliasList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHAliasList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getDisasterRecoveryConfigs()
+ .list("exampleResourceGroup", "sdk-Namespace-8859", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsCreateOrUpdateAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsCreateOrUpdateAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..17fa5689897d4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsCreateOrUpdateAuthorizationRuleSamples.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner;
+import com.azure.resourcemanager.eventhubs.models.AccessRights;
+import java.util.Arrays;
+
+/** Samples for EventHubs CreateOrUpdateAuthorizationRule. */
+public final class EventHubsCreateOrUpdateAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleCreate.json
+ */
+ /**
+ * Sample code: EventHubAuthorizationRuleCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubAuthorizationRuleCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .createOrUpdateAuthorizationRuleWithResponse(
+ "ArunMonocle",
+ "sdk-Namespace-960",
+ "sdk-EventHub-532",
+ "sdk-Authrules-2513",
+ new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..589308811ee0e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsCreateOrUpdateSamples.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner;
+import com.azure.resourcemanager.eventhubs.models.CaptureDescription;
+import com.azure.resourcemanager.eventhubs.models.Destination;
+import com.azure.resourcemanager.eventhubs.models.EncodingCaptureDescription;
+import com.azure.resourcemanager.eventhubs.models.EntityStatus;
+
+/** Samples for EventHubs CreateOrUpdate. */
+public final class EventHubsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubCreate.json
+ */
+ /**
+ * Sample code: EventHubCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .createOrUpdateWithResponse(
+ "Default-NotificationHubs-AustraliaEast",
+ "sdk-Namespace-5357",
+ "sdk-EventHub-6547",
+ new EventhubInner()
+ .withMessageRetentionInDays(4L)
+ .withPartitionCount(4L)
+ .withStatus(EntityStatus.ACTIVE)
+ .withCaptureDescription(
+ new CaptureDescription()
+ .withEnabled(true)
+ .withEncoding(EncodingCaptureDescription.AVRO)
+ .withIntervalInSeconds(120)
+ .withSizeLimitInBytes(10485763)
+ .withDestination(
+ new Destination()
+ .withName("EventHubArchive.AzureBlockBlob")
+ .withStorageAccountResourceId(
+ "/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage")
+ .withBlobContainer("container")
+ .withArchiveNameFormat(
+ "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsDeleteAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsDeleteAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..4a9e6a2a72f1a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsDeleteAuthorizationRuleSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs DeleteAuthorizationRule. */
+public final class EventHubsDeleteAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleDelete.json
+ */
+ /**
+ * Sample code: EventHubAuthorizationRuleDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubAuthorizationRuleDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .deleteAuthorizationRuleWithResponse(
+ "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsDeleteSamples.java
new file mode 100644
index 0000000000000..445fa6c658ae0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs Delete. */
+public final class EventHubsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubDelete.json
+ */
+ /**
+ * Sample code: EventHubDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .deleteWithResponse("ArunMonocle", "sdk-Namespace-5357", "sdk-EventHub-6547", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..d567f40dc5290
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetAuthorizationRuleSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs GetAuthorizationRule. */
+public final class EventHubsGetAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleGet.json
+ */
+ /**
+ * Sample code: EventHubAuthorizationRuleGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubAuthorizationRuleGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .getAuthorizationRuleWithResponse(
+ "ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetSamples.java
new file mode 100644
index 0000000000000..c3369e897b7fe
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs Get. */
+public final class EventHubsGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubGet.json
+ */
+ /**
+ * Sample code: EventHubGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .getWithResponse(
+ "Default-NotificationHubs-AustraliaEast", "sdk-Namespace-716", "sdk-EventHub-10", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListAuthorizationRulesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListAuthorizationRulesSamples.java
new file mode 100644
index 0000000000000..8c9cea7f1f327
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListAuthorizationRulesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs ListAuthorizationRules. */
+public final class EventHubsListAuthorizationRulesSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListAll.json
+ */
+ /**
+ * Sample code: EventHubAuthorizationRuleListAll.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubAuthorizationRuleListAll(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .listAuthorizationRules("ArunMonocle", "sdk-Namespace-960", "sdk-EventHub-532", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListByNamespaceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListByNamespaceSamples.java
new file mode 100644
index 0000000000000..4a7b6cf36935b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListByNamespaceSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs ListByNamespace. */
+public final class EventHubsListByNamespaceSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubListByNameSpace.json
+ */
+ /**
+ * Sample code: EventHubsListAll.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubsListAll(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .listByNamespace("Default-NotificationHubs-AustraliaEast", "sdk-Namespace-5357", null, null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListKeysSamples.java
new file mode 100644
index 0000000000000..ea13936794ce7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsListKeysSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for EventHubs ListKeys. */
+public final class EventHubsListKeysSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListKey.json
+ */
+ /**
+ * Sample code: EventHubAuthorizationRuleListKey.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubAuthorizationRuleListKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .listKeysWithResponse(
+ "ArunMonocle", "sdk-namespace-960", "sdk-EventHub-532", "sdk-Authrules-2513", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsRegenerateKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsRegenerateKeysSamples.java
new file mode 100644
index 0000000000000..584df40e47808
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/EventHubsRegenerateKeysSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.models.KeyType;
+import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters;
+
+/** Samples for EventHubs RegenerateKeys. */
+public final class EventHubsRegenerateKeysSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleRegenerateKey.json
+ */
+ /**
+ * Sample code: EventHubAuthorizationRuleRegenerateKey.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eventHubAuthorizationRuleRegenerateKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getEventHubs()
+ .regenerateKeysWithResponse(
+ "ArunMonocle",
+ "sdk-namespace-960",
+ "sdk-EventHub-532",
+ "sdk-Authrules-1534",
+ new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCheckNameAvailabilitySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCheckNameAvailabilitySamples.java
new file mode 100644
index 0000000000000..9e6a199893099
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCheckNameAvailabilitySamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter;
+
+/** Samples for Namespaces CheckNameAvailability. */
+public final class NamespacesCheckNameAvailabilitySamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json
+ */
+ /**
+ * Sample code: NamespacesCheckNameAvailability.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void namespacesCheckNameAvailability(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .checkNameAvailabilityWithResponse(
+ new CheckNameAvailabilityParameter().withName("sdk-Namespace-8458"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..64ebc8a582fcf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateAuthorizationRuleSamples.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner;
+import com.azure.resourcemanager.eventhubs.models.AccessRights;
+import java.util.Arrays;
+
+/** Samples for Namespaces CreateOrUpdateAuthorizationRule. */
+public final class NamespacesCreateOrUpdateAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleCreate.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .createOrUpdateAuthorizationRuleWithResponse(
+ "ArunMonocle",
+ "sdk-Namespace-2702",
+ "sdk-Authrules-1746",
+ new AuthorizationRuleInner().withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java
new file mode 100644
index 0000000000000..9a032c0fed4e1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateNetworkRuleSetSamples.java
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.NetworkRuleSetInner;
+import com.azure.resourcemanager.eventhubs.models.DefaultAction;
+import com.azure.resourcemanager.eventhubs.models.NWRuleSetIpRules;
+import com.azure.resourcemanager.eventhubs.models.NWRuleSetVirtualNetworkRules;
+import com.azure.resourcemanager.eventhubs.models.NetworkRuleIpAction;
+import com.azure.resourcemanager.eventhubs.models.Subnet;
+import java.util.Arrays;
+
+/** Samples for Namespaces CreateOrUpdateNetworkRuleSet. */
+public final class NamespacesCreateOrUpdateNetworkRuleSetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetCreate.json
+ */
+ /**
+ * Sample code: NameSpaceNetworkRuleSetCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceNetworkRuleSetCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .createOrUpdateNetworkRuleSetWithResponse(
+ "ResourceGroup",
+ "sdk-Namespace-6019",
+ new NetworkRuleSetInner()
+ .withDefaultAction(DefaultAction.DENY)
+ .withVirtualNetworkRules(
+ Arrays
+ .asList(
+ new NWRuleSetVirtualNetworkRules()
+ .withSubnet(
+ new Subnet()
+ .withId(
+ "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"))
+ .withIgnoreMissingVnetServiceEndpoint(true),
+ new NWRuleSetVirtualNetworkRules()
+ .withSubnet(
+ new Subnet()
+ .withId(
+ "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"))
+ .withIgnoreMissingVnetServiceEndpoint(false),
+ new NWRuleSetVirtualNetworkRules()
+ .withSubnet(
+ new Subnet()
+ .withId(
+ "/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"))
+ .withIgnoreMissingVnetServiceEndpoint(false)))
+ .withIpRules(
+ Arrays
+ .asList(
+ new NWRuleSetIpRules().withIpMask("1.1.1.1").withAction(NetworkRuleIpAction.ALLOW),
+ new NWRuleSetIpRules().withIpMask("1.1.1.2").withAction(NetworkRuleIpAction.ALLOW),
+ new NWRuleSetIpRules().withIpMask("1.1.1.3").withAction(NetworkRuleIpAction.ALLOW),
+ new NWRuleSetIpRules().withIpMask("1.1.1.4").withAction(NetworkRuleIpAction.ALLOW),
+ new NWRuleSetIpRules().withIpMask("1.1.1.5").withAction(NetworkRuleIpAction.ALLOW))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..716b74d5a7fe0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesCreateOrUpdateSamples.java
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner;
+import com.azure.resourcemanager.eventhubs.models.Encryption;
+import com.azure.resourcemanager.eventhubs.models.Identity;
+import com.azure.resourcemanager.eventhubs.models.KeySource;
+import com.azure.resourcemanager.eventhubs.models.KeyVaultProperties;
+import com.azure.resourcemanager.eventhubs.models.ManagedServiceIdentityType;
+import com.azure.resourcemanager.eventhubs.models.UserAssignedIdentity;
+import com.azure.resourcemanager.eventhubs.models.UserAssignedIdentityProperties;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Namespaces CreateOrUpdate. */
+public final class NamespacesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCreate.json
+ */
+ /**
+ * Sample code: NamespaceCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void namespaceCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .createOrUpdate(
+ "ResurceGroupSample",
+ "NamespaceSample",
+ new EHNamespaceInner()
+ .withLocation("East US")
+ .withIdentity(
+ new Identity()
+ .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1",
+ new UserAssignedIdentity(),
+ "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2",
+ new UserAssignedIdentity())))
+ .withClusterArmId(
+ "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/clusters/enc-test")
+ .withEncryption(
+ new Encryption()
+ .withKeyVaultProperties(
+ Arrays
+ .asList(
+ new KeyVaultProperties()
+ .withKeyName("Samplekey")
+ .withKeyVaultUri("https://aprao-keyvault-user.vault-int.azure-int.net/")
+ .withIdentity(
+ new UserAssignedIdentityProperties()
+ .withUserAssignedIdentity(
+ "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1"))))
+ .withKeySource(KeySource.MICROSOFT_KEY_VAULT)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..a37fe10d53aa8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesDeleteAuthorizationRuleSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces DeleteAuthorizationRule. */
+public final class NamespacesDeleteAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleDelete.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .deleteAuthorizationRuleWithResponse(
+ "ArunMonocle", "sdk-Namespace-8980", "sdk-Authrules-8929", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesDeleteSamples.java
new file mode 100644
index 0000000000000..0f8826af7f0ea
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces Delete. */
+public final class NamespacesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceDelete.json
+ */
+ /**
+ * Sample code: NameSpaceDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .delete("ResurceGroupSample", "NamespaceSample", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetAuthorizationRuleSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetAuthorizationRuleSamples.java
new file mode 100644
index 0000000000000..9796972f95032
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetAuthorizationRuleSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces GetAuthorizationRule. */
+public final class NamespacesGetAuthorizationRuleSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleGet.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .getAuthorizationRuleWithResponse("ArunMonocle", "sdk-Namespace-2702", "sdk-Authrules-1746", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..b7ca693c8e8af
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces GetByResourceGroup. */
+public final class NamespacesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceGet.json
+ */
+ /**
+ * Sample code: NameSpaceGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .getByResourceGroupWithResponse("ResurceGroupSample", "NamespaceSample", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetNetworkRuleSetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetNetworkRuleSetSamples.java
new file mode 100644
index 0000000000000..93e8735b99893
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesGetNetworkRuleSetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces GetNetworkRuleSet. */
+public final class NamespacesGetNetworkRuleSetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetGet.json
+ */
+ /**
+ * Sample code: NameSpaceNetworkRuleSetGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceNetworkRuleSetGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .getNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListAuthorizationRulesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListAuthorizationRulesSamples.java
new file mode 100644
index 0000000000000..d3a0d3c537b34
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListAuthorizationRulesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces ListAuthorizationRules. */
+public final class NamespacesListAuthorizationRulesSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json
+ */
+ /**
+ * Sample code: ListAuthorizationRules.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAuthorizationRules(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .listAuthorizationRules("ArunMonocle", "sdk-Namespace-2702", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..f55d8728b578d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces ListByResourceGroup. */
+public final class NamespacesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceListByResourceGroup.json
+ */
+ /**
+ * Sample code: NamespaceListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void namespaceListByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .listByResourceGroup("ResurceGroupSample", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListKeysSamples.java
new file mode 100644
index 0000000000000..c1a39646752dd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListKeysSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces ListKeys. */
+public final class NamespacesListKeysSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListKey.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleListKey.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleListKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .listKeysWithResponse("ArunMonocle", "sdk-Namespace-2702", "sdk-Authrules-1746", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListNetworkRuleSetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListNetworkRuleSetSamples.java
new file mode 100644
index 0000000000000..25a788ff48c55
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListNetworkRuleSetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces ListNetworkRuleSet. */
+public final class NamespacesListNetworkRuleSetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetList.json
+ */
+ /**
+ * Sample code: NameSpaceNetworkRuleSetList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceNetworkRuleSetList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .listNetworkRuleSetWithResponse("ResourceGroup", "sdk-Namespace-6019", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListSamples.java
new file mode 100644
index 0000000000000..31c3b91f4c8b3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Namespaces List. */
+public final class NamespacesListSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceList.json
+ */
+ /**
+ * Sample code: NamespacesListBySubscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void namespacesListBySubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.eventHubs().manager().serviceClient().getNamespaces().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesRegenerateKeysSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesRegenerateKeysSamples.java
new file mode 100644
index 0000000000000..c26148843bb8a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesRegenerateKeysSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.models.KeyType;
+import com.azure.resourcemanager.eventhubs.models.RegenerateAccessKeyParameters;
+
+/** Samples for Namespaces RegenerateKeys. */
+public final class NamespacesRegenerateKeysSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleRegenerateKey.json
+ */
+ /**
+ * Sample code: NameSpaceAuthorizationRuleRegenerateKey.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceAuthorizationRuleRegenerateKey(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .regenerateKeysWithResponse(
+ "ArunMonocle",
+ "sdk-Namespace-8980",
+ "sdk-Authrules-8929",
+ new RegenerateAccessKeyParameters().withKeyType(KeyType.PRIMARY_KEY),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesUpdateSamples.java
new file mode 100644
index 0000000000000..5ac79a5e5aa3d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/NamespacesUpdateSamples.java
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.EHNamespaceInner;
+import com.azure.resourcemanager.eventhubs.models.Identity;
+import com.azure.resourcemanager.eventhubs.models.ManagedServiceIdentityType;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for Namespaces Update. */
+public final class NamespacesUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceUpdate.json
+ */
+ /**
+ * Sample code: NamespacesUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void namespacesUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getNamespaces()
+ .updateWithResponse(
+ "ResurceGroupSample",
+ "NamespaceSample",
+ new EHNamespaceInner()
+ .withLocation("East US")
+ .withIdentity(
+ new Identity()
+ .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2",
+ null))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/OperationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/OperationsListSamples.java
new file mode 100644
index 0000000000000..da230a2037ff9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/OperationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for Operations List. */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EHOperations_List.json
+ */
+ /**
+ * Sample code: EHOperations_List.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void eHOperationsList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.eventHubs().manager().serviceClient().getOperations().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5697aeb732a82
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.eventhubs.models.ConnectionState;
+import com.azure.resourcemanager.eventhubs.models.EndPointProvisioningState;
+import com.azure.resourcemanager.eventhubs.models.PrivateEndpoint;
+import com.azure.resourcemanager.eventhubs.models.PrivateLinkConnectionStatus;
+
+/** Samples for PrivateEndpointConnections CreateOrUpdate. */
+public final class PrivateEndpointConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json
+ */
+ /**
+ * Sample code: NameSpacePrivateEndPointConnectionCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpacePrivateEndPointConnectionCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .createOrUpdateWithResponse(
+ "ArunMonocle",
+ "sdk-Namespace-2924",
+ "privateEndpointConnectionName",
+ new PrivateEndpointConnectionInner()
+ .withPrivateEndpoint(
+ new PrivateEndpoint()
+ .withId(
+ "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-EventHub-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847"))
+ .withPrivateLinkServiceConnectionState(
+ new ConnectionState()
+ .withStatus(PrivateLinkConnectionStatus.REJECTED)
+ .withDescription("testing"))
+ .withProvisioningState(EndPointProvisioningState.SUCCEEDED),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..9f1fc0b4b6d02
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Delete. */
+public final class PrivateEndpointConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json
+ */
+ /**
+ * Sample code: NameSpacePrivateEndPointConnectionDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpacePrivateEndPointConnectionDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .delete("ArunMonocle", "sdk-Namespace-3285", "928c44d5-b7c6-423b-b6fa-811e0c27b3e0", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsGetSamples.java
new file mode 100644
index 0000000000000..6b51fb049179d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections Get. */
+public final class PrivateEndpointConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json
+ */
+ /**
+ * Sample code: NameSpacePrivateEndPointConnectionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpacePrivateEndPointConnectionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse("SDK-EventHub-4794", "sdk-Namespace-5828", "privateEndpointConnectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsListSamples.java
new file mode 100644
index 0000000000000..9518ba31cf82b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateEndpointConnectionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateEndpointConnections List. */
+public final class PrivateEndpointConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json
+ */
+ /**
+ * Sample code: NameSpaceCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpaceCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .list("SDK-EventHub-4794", "sdk-Namespace-5828", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateLinkResourcesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateLinkResourcesGetSamples.java
new file mode 100644
index 0000000000000..827b919ccb2b9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/PrivateLinkResourcesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for PrivateLinkResources Get. */
+public final class PrivateLinkResourcesGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json
+ */
+ /**
+ * Sample code: NameSpacePrivateLinkResourcesGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void nameSpacePrivateLinkResourcesGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getPrivateLinkResources()
+ .getWithResponse("ArunMonocle", "sdk-Namespace-2924", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..fd67e41fd1775
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryCreateOrUpdateSamples.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.eventhubs.fluent.models.SchemaGroupInner;
+import com.azure.resourcemanager.eventhubs.models.SchemaCompatibility;
+import com.azure.resourcemanager.eventhubs.models.SchemaType;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for SchemaRegistry CreateOrUpdate. */
+public final class SchemaRegistryCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryCreate.json
+ */
+ /**
+ * Sample code: SchemaRegistryCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void schemaRegistryCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getSchemaRegistries()
+ .createOrUpdateWithResponse(
+ "alitest",
+ "ali-ua-test-eh-system-1",
+ "testSchemaGroup1",
+ new SchemaGroupInner()
+ .withGroupProperties(mapOf())
+ .withSchemaCompatibility(SchemaCompatibility.FORWARD)
+ .withSchemaType(SchemaType.AVRO),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryDeleteSamples.java
new file mode 100644
index 0000000000000..4dca6421b157e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SchemaRegistry Delete. */
+public final class SchemaRegistryDeleteSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryDelete.json
+ */
+ /**
+ * Sample code: SchemaRegistryDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void schemaRegistryDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getSchemaRegistries()
+ .deleteWithResponse("alitest", "ali-ua-test-eh-system-1", "testSchemaGroup1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryGetSamples.java
new file mode 100644
index 0000000000000..76932176d0492
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SchemaRegistry Get. */
+public final class SchemaRegistryGetSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryGet.json
+ */
+ /**
+ * Sample code: SchemaRegistryGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void schemaRegistryGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getSchemaRegistries()
+ .getWithResponse("alitest", "ali-ua-test-eh-system-1", "testSchemaGroup1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryListByNamespaceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryListByNamespaceSamples.java
new file mode 100644
index 0000000000000..817cadf540de9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/eventhubs/generated/SchemaRegistryListByNamespaceSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.eventhubs.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for SchemaRegistry ListByNamespace. */
+public final class SchemaRegistryListByNamespaceSamples {
+ /*
+ * x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryListByNamespace.json
+ */
+ /**
+ * Sample code: SchemaRegistryListAll.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void schemaRegistryListAll(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .eventHubs()
+ .manager()
+ .serviceClient()
+ .getSchemaRegistries()
+ .listByNamespace("alitest", "ali-ua-test-eh-system-1", null, null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..e2e401b1851e1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections Delete. */
+public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayPrivateEndpointConnectionDelete.json
+ */
+ /**
+ * Sample code: Delete Application Gateway Private Endpoint Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteApplicationGatewayPrivateEndpointConnection(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGatewayPrivateEndpointConnections()
+ .delete("rg1", "appgw", "connection1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java
new file mode 100644
index 0000000000000..5d299544c218a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections Get. */
+public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayPrivateEndpointConnectionGet.json
+ */
+ /**
+ * Sample code: Get Application Gateway Private Endpoint Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getApplicationGatewayPrivateEndpointConnection(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGatewayPrivateEndpointConnections()
+ .getWithResponse("rg1", "appgw", "connection1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java
new file mode 100644
index 0000000000000..cd3cf7a83b845
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections List. */
+public final class ApplicationGatewayPrivateEndpointConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayPrivateEndpointConnectionList.json
+ */
+ /**
+ * Sample code: Lists all private endpoint connections on application gateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllPrivateEndpointConnectionsOnApplicationGateway(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGatewayPrivateEndpointConnections()
+ .list("rg1", "appgw", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.java
new file mode 100644
index 0000000000000..7909eae6011c5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner;
+import com.azure.resourcemanager.network.models.PrivateLinkServiceConnectionState;
+
+/** Samples for ApplicationGatewayPrivateEndpointConnections Update. */
+public final class ApplicationGatewayPrivateEndpointConnectionsUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayPrivateEndpointConnectionUpdate.json
+ */
+ /**
+ * Sample code: Update Application Gateway Private Endpoint Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateApplicationGatewayPrivateEndpointConnection(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGatewayPrivateEndpointConnections()
+ .update(
+ "rg1",
+ "appgw",
+ "connection1",
+ new ApplicationGatewayPrivateEndpointConnectionInner()
+ .withName("connection1")
+ .withPrivateLinkServiceConnectionState(
+ new PrivateLinkServiceConnectionState()
+ .withStatus("Approved")
+ .withDescription("approved it for some reason.")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java
new file mode 100644
index 0000000000000..7f12866c5fe23
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGatewayPrivateLinkResources List. */
+public final class ApplicationGatewayPrivateLinkResourcesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayPrivateLinkResourceList.json
+ */
+ /**
+ * Sample code: Lists all private link resources on application gateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllPrivateLinkResourcesOnApplicationGateway(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGatewayPrivateLinkResources()
+ .list("rg1", "appgw", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java
new file mode 100644
index 0000000000000..2fa671b321457
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.ApplicationGatewayOnDemandProbe;
+import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol;
+
+/** Samples for ApplicationGateways BackendHealthOnDemand. */
+public final class ApplicationGatewaysBackendHealthOnDemandSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayBackendHealthTest.json
+ */
+ /**
+ * Sample code: Test Backend Health.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void testBackendHealth(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .backendHealthOnDemand(
+ "rg1",
+ "appgw",
+ new ApplicationGatewayOnDemandProbe()
+ .withProtocol(ApplicationGatewayProtocol.HTTP)
+ .withPath("/")
+ .withTimeout(30)
+ .withPickHostnameFromBackendHttpSettings(true)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool"))
+ .withBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings")),
+ null,
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysBackendHealthSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysBackendHealthSamples.java
new file mode 100644
index 0000000000000..aebe017eb0988
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysBackendHealthSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways BackendHealth. */
+public final class ApplicationGatewaysBackendHealthSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayBackendHealthGet.json
+ */
+ /**
+ * Sample code: Get Backend Health.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getBackendHealth(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .backendHealth("appgw", "appgw", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..26f83d8ae3267
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysCreateOrUpdateSamples.java
@@ -0,0 +1,376 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayIpConfigurationInner;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayPathRuleInner;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayRequestRoutingRuleInner;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslCertificateInner;
+import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayUrlPathMapInner;
+import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddress;
+import com.azure.resourcemanager.network.models.ApplicationGatewayBackendAddressPool;
+import com.azure.resourcemanager.network.models.ApplicationGatewayBackendHttpSettings;
+import com.azure.resourcemanager.network.models.ApplicationGatewayClientAuthConfiguration;
+import com.azure.resourcemanager.network.models.ApplicationGatewayCookieBasedAffinity;
+import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendIpConfiguration;
+import com.azure.resourcemanager.network.models.ApplicationGatewayFrontendPort;
+import com.azure.resourcemanager.network.models.ApplicationGatewayGlobalConfiguration;
+import com.azure.resourcemanager.network.models.ApplicationGatewayHeaderConfiguration;
+import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener;
+import com.azure.resourcemanager.network.models.ApplicationGatewayLoadDistributionAlgorithm;
+import com.azure.resourcemanager.network.models.ApplicationGatewayLoadDistributionPolicy;
+import com.azure.resourcemanager.network.models.ApplicationGatewayLoadDistributionTarget;
+import com.azure.resourcemanager.network.models.ApplicationGatewayProtocol;
+import com.azure.resourcemanager.network.models.ApplicationGatewayRequestRoutingRuleType;
+import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRule;
+import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRuleActionSet;
+import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRuleCondition;
+import com.azure.resourcemanager.network.models.ApplicationGatewayRewriteRuleSet;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySku;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySkuName;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySslCipherSuite;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicy;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySslPolicyType;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySslProfile;
+import com.azure.resourcemanager.network.models.ApplicationGatewaySslProtocol;
+import com.azure.resourcemanager.network.models.ApplicationGatewayTier;
+import com.azure.resourcemanager.network.models.ApplicationGatewayTrustedClientCertificate;
+import com.azure.resourcemanager.network.models.ApplicationGatewayTrustedRootCertificate;
+import com.azure.resourcemanager.network.models.ApplicationGatewayUrlConfiguration;
+import com.azure.resourcemanager.network.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.network.models.ManagedServiceIdentityUserAssignedIdentities;
+import com.azure.resourcemanager.network.models.ResourceIdentityType;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ApplicationGateways CreateOrUpdate. */
+public final class ApplicationGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayCreate.json
+ */
+ /**
+ * Sample code: Create Application Gateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createApplicationGateway(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .createOrUpdate(
+ "rg1",
+ "appgw",
+ new ApplicationGatewayInner()
+ .withLocation("eastus")
+ .withIdentity(
+ new ManagedServiceIdentity()
+ .withType(ResourceIdentityType.USER_ASSIGNED)
+ .withUserAssignedIdentities(
+ mapOf(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1",
+ new ManagedServiceIdentityUserAssignedIdentities())))
+ .withSku(
+ new ApplicationGatewaySku()
+ .withName(ApplicationGatewaySkuName.STANDARD_V2)
+ .withTier(ApplicationGatewayTier.STANDARD_V2)
+ .withCapacity(3))
+ .withGatewayIpConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayIpConfigurationInner()
+ .withName("appgwipc")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet"))))
+ .withTrustedRootCertificates(
+ Arrays
+ .asList(
+ new ApplicationGatewayTrustedRootCertificate().withName("rootcert").withData("****"),
+ new ApplicationGatewayTrustedRootCertificate()
+ .withName("rootcert1")
+ .withKeyVaultSecretId("https://kv/secret")))
+ .withTrustedClientCertificates(
+ Arrays
+ .asList(
+ new ApplicationGatewayTrustedClientCertificate()
+ .withName("clientcert")
+ .withData("****")))
+ .withSslCertificates(
+ Arrays
+ .asList(
+ new ApplicationGatewaySslCertificateInner()
+ .withName("sslcert")
+ .withData("****")
+ .withPassword("****"),
+ new ApplicationGatewaySslCertificateInner()
+ .withName("sslcert2")
+ .withKeyVaultSecretId("https://kv/secret")))
+ .withFrontendIpConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayFrontendIpConfiguration()
+ .withName("appgwfip")
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip"))))
+ .withFrontendPorts(
+ Arrays
+ .asList(
+ new ApplicationGatewayFrontendPort().withName("appgwfp").withPort(443),
+ new ApplicationGatewayFrontendPort().withName("appgwfp80").withPort(80)))
+ .withBackendAddressPools(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendAddressPool()
+ .withName("appgwpool")
+ .withBackendAddresses(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.1"),
+ new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.2"))),
+ new ApplicationGatewayBackendAddressPool()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1")
+ .withName("appgwpool1")
+ .withBackendAddresses(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendAddress(),
+ new ApplicationGatewayBackendAddress()))))
+ .withBackendHttpSettingsCollection(
+ Arrays
+ .asList(
+ new ApplicationGatewayBackendHttpSettings()
+ .withName("appgwbhs")
+ .withPort(80)
+ .withProtocol(ApplicationGatewayProtocol.HTTP)
+ .withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity.DISABLED)
+ .withRequestTimeout(30)))
+ .withHttpListeners(
+ Arrays
+ .asList(
+ new ApplicationGatewayHttpListener()
+ .withName("appgwhl")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"))
+ .withFrontendPort(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp"))
+ .withProtocol(ApplicationGatewayProtocol.HTTPS)
+ .withSslCertificate(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert"))
+ .withSslProfile(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1"))
+ .withRequireServerNameIndication(false),
+ new ApplicationGatewayHttpListener()
+ .withName("appgwhttplistener")
+ .withFrontendIpConfiguration(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip"))
+ .withFrontendPort(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80"))
+ .withProtocol(ApplicationGatewayProtocol.HTTP)))
+ .withSslProfiles(
+ Arrays
+ .asList(
+ new ApplicationGatewaySslProfile()
+ .withName("sslProfile1")
+ .withTrustedClientCertificates(
+ Arrays
+ .asList(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert")))
+ .withSslPolicy(
+ new ApplicationGatewaySslPolicy()
+ .withPolicyType(ApplicationGatewaySslPolicyType.CUSTOM)
+ .withCipherSuites(
+ Arrays
+ .asList(
+ ApplicationGatewaySslCipherSuite
+ .TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256))
+ .withMinProtocolVersion(ApplicationGatewaySslProtocol.TLSV1_1))
+ .withClientAuthConfiguration(
+ new ApplicationGatewayClientAuthConfiguration()
+ .withVerifyClientCertIssuerDN(true))))
+ .withUrlPathMaps(
+ Arrays
+ .asList(
+ new ApplicationGatewayUrlPathMapInner()
+ .withName("pathMap1")
+ .withDefaultBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"))
+ .withDefaultBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"))
+ .withDefaultRewriteRuleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"))
+ .withDefaultLoadDistributionPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"))
+ .withPathRules(
+ Arrays
+ .asList(
+ new ApplicationGatewayPathRuleInner()
+ .withName("apiPaths")
+ .withPaths(Arrays.asList("/api", "/v1/api"))
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"))
+ .withBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"))
+ .withRewriteRuleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"))
+ .withLoadDistributionPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1"))))))
+ .withRequestRoutingRules(
+ Arrays
+ .asList(
+ new ApplicationGatewayRequestRoutingRuleInner()
+ .withName("appgwrule")
+ .withRuleType(ApplicationGatewayRequestRoutingRuleType.BASIC)
+ .withPriority(10)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool"))
+ .withBackendHttpSettings(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs"))
+ .withHttpListener(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl"))
+ .withRewriteRuleSet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"))
+ .withLoadDistributionPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/loadDistributionPolicies/ldp1")),
+ new ApplicationGatewayRequestRoutingRuleInner()
+ .withName("appgwPathBasedRule")
+ .withRuleType(ApplicationGatewayRequestRoutingRuleType.PATH_BASED_ROUTING)
+ .withPriority(20)
+ .withHttpListener(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhttplistener"))
+ .withUrlPathMap(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/urlPathMaps/pathMap1"))))
+ .withRewriteRuleSets(
+ Arrays
+ .asList(
+ new ApplicationGatewayRewriteRuleSet()
+ .withName("rewriteRuleSet1")
+ .withRewriteRules(
+ Arrays
+ .asList(
+ new ApplicationGatewayRewriteRule()
+ .withName("Set X-Forwarded-For")
+ .withRuleSequence(102)
+ .withConditions(
+ Arrays
+ .asList(
+ new ApplicationGatewayRewriteRuleCondition()
+ .withVariable("http_req_Authorization")
+ .withPattern("^Bearer")
+ .withIgnoreCase(true)
+ .withNegate(false)))
+ .withActionSet(
+ new ApplicationGatewayRewriteRuleActionSet()
+ .withRequestHeaderConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayHeaderConfiguration()
+ .withHeaderName("X-Forwarded-For")
+ .withHeaderValue(
+ "{var_add_x_forwarded_for_proxy}")))
+ .withResponseHeaderConfigurations(
+ Arrays
+ .asList(
+ new ApplicationGatewayHeaderConfiguration()
+ .withHeaderName("Strict-Transport-Security")
+ .withHeaderValue("max-age=31536000")))
+ .withUrlConfiguration(
+ new ApplicationGatewayUrlConfiguration()
+ .withModifiedPath("/abc")))))))
+ .withLoadDistributionPolicies(
+ Arrays
+ .asList(
+ new ApplicationGatewayLoadDistributionPolicy()
+ .withName("ldp1")
+ .withLoadDistributionTargets(
+ Arrays
+ .asList(
+ new ApplicationGatewayLoadDistributionTarget()
+ .withName("ld11")
+ .withWeightPerServer(40)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")),
+ new ApplicationGatewayLoadDistributionTarget()
+ .withName("ld11")
+ .withWeightPerServer(60)
+ .withBackendAddressPool(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"))))
+ .withLoadDistributionAlgorithm(
+ ApplicationGatewayLoadDistributionAlgorithm.ROUND_ROBIN)))
+ .withGlobalConfiguration(
+ new ApplicationGatewayGlobalConfiguration()
+ .withEnableRequestBuffering(true)
+ .withEnableResponseBuffering(true)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysDeleteSamples.java
new file mode 100644
index 0000000000000..ff81d1de339de
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways Delete. */
+public final class ApplicationGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayDelete.json
+ */
+ /**
+ * Sample code: Delete ApplicationGateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteApplicationGateway(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getApplicationGateways().delete("rg1", "appgw", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..73872d538d177
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways GetByResourceGroup. */
+public final class ApplicationGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayGet.json
+ */
+ /**
+ * Sample code: Get ApplicationGateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getApplicationGateway(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .getByResourceGroupWithResponse("rg1", "appgw", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.java
new file mode 100644
index 0000000000000..c3bba287ca6ae
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways GetSslPredefinedPolicy. */
+public final class ApplicationGatewaysGetSslPredefinedPolicySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json
+ */
+ /**
+ * Sample code: Get Available Ssl Predefined Policy by name.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableSslPredefinedPolicyByName(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .getSslPredefinedPolicyWithResponse("AppGwSslPolicy20150501", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java
new file mode 100644
index 0000000000000..d4a11ea8e2dd9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableRequestHeaders. */
+public final class ApplicationGatewaysListAvailableRequestHeadersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableRequestHeadersGet.json
+ */
+ /**
+ * Sample code: Get Available Request Headers.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableRequestHeaders(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .listAvailableRequestHeadersWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java
new file mode 100644
index 0000000000000..4a32ba31299ec
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableResponseHeaders. */
+public final class ApplicationGatewaysListAvailableResponseHeadersSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableResponseHeadersGet.json
+ */
+ /**
+ * Sample code: Get Available Response Headers.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableResponseHeaders(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .listAvailableResponseHeadersWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java
new file mode 100644
index 0000000000000..778ad1ff531b8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableServerVariables. */
+public final class ApplicationGatewaysListAvailableServerVariablesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableServerVariablesGet.json
+ */
+ /**
+ * Sample code: Get Available Server Variables.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableServerVariables(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .listAvailableServerVariablesWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java
new file mode 100644
index 0000000000000..4d56ec654f9c1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableSslOptions. */
+public final class ApplicationGatewaysListAvailableSslOptionsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableSslOptionsGet.json
+ */
+ /**
+ * Sample code: Get Available Ssl Options.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableSslOptions(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .listAvailableSslOptionsWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java
new file mode 100644
index 0000000000000..10f9eba7cc552
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. */
+public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json
+ */
+ /**
+ * Sample code: Get Available Ssl Predefined Policies.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableSslPredefinedPolicies(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .listAvailableSslPredefinedPolicies(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java
new file mode 100644
index 0000000000000..b17a716f44486
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListAvailableWafRuleSets. */
+public final class ApplicationGatewaysListAvailableWafRuleSetsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayAvailableWafRuleSetsGet.json
+ */
+ /**
+ * Sample code: Get Available Waf Rule Sets.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableWafRuleSets(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .listAvailableWafRuleSetsWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..8ce1a2f2a5051
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListByResourceGroupSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways ListByResourceGroup. */
+public final class ApplicationGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayList.json
+ */
+ /**
+ * Sample code: Lists all application gateways in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllApplicationGatewaysInAResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getApplicationGateways().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListSamples.java
new file mode 100644
index 0000000000000..33bb385be62fc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways List. */
+public final class ApplicationGatewaysListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayListAll.json
+ */
+ /**
+ * Sample code: Lists all application gateways in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listsAllApplicationGatewaysInASubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getApplicationGateways().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysStartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysStartSamples.java
new file mode 100644
index 0000000000000..e88344580e9c4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysStartSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways Start. */
+public final class ApplicationGatewaysStartSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayStart.json
+ */
+ /**
+ * Sample code: Start Application Gateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void startApplicationGateway(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getApplicationGateways().start("rg1", "appgw", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysStopSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysStopSamples.java
new file mode 100644
index 0000000000000..d8317b7b71b22
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysStopSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationGateways Stop. */
+public final class ApplicationGatewaysStopSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayStop.json
+ */
+ /**
+ * Sample code: Stop Application Gateway.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void stopApplicationGateway(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getApplicationGateways().stop("rg1", "appgw", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysUpdateTagsSamples.java
new file mode 100644
index 0000000000000..f3f83950dae5c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationGatewaysUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ApplicationGateways UpdateTags. */
+public final class ApplicationGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: Update Application Gateway tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateApplicationGatewayTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationGateways()
+ .updateTagsWithResponse(
+ "rg1", "AppGw", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..5c6848b9ace2c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner;
+
+/** Samples for ApplicationSecurityGroups CreateOrUpdate. */
+public final class ApplicationSecurityGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationSecurityGroupCreate.json
+ */
+ /**
+ * Sample code: Create application security group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createApplicationSecurityGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationSecurityGroups()
+ .createOrUpdate(
+ "rg1", "test-asg", new ApplicationSecurityGroupInner().withLocation("westus"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsDeleteSamples.java
new file mode 100644
index 0000000000000..ff87833e2de55
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups Delete. */
+public final class ApplicationSecurityGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationSecurityGroupDelete.json
+ */
+ /**
+ * Sample code: Delete application security group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteApplicationSecurityGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationSecurityGroups()
+ .delete("rg1", "test-asg", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..c3d7456e84cfc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups GetByResourceGroup. */
+public final class ApplicationSecurityGroupsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationSecurityGroupGet.json
+ */
+ /**
+ * Sample code: Get application security group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getApplicationSecurityGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationSecurityGroups()
+ .getByResourceGroupWithResponse("rg1", "test-asg", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..27907f2de839e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups ListByResourceGroup. */
+public final class ApplicationSecurityGroupsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationSecurityGroupList.json
+ */
+ /**
+ * Sample code: List load balancers in resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listLoadBalancersInResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationSecurityGroups()
+ .listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsListSamples.java
new file mode 100644
index 0000000000000..e0e1f5fd03fd7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ApplicationSecurityGroups List. */
+public final class ApplicationSecurityGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationSecurityGroupListAll.json
+ */
+ /**
+ * Sample code: List all application security groups.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllApplicationSecurityGroups(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getApplicationSecurityGroups().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..79b20294f5f00
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ApplicationSecurityGroupsUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ApplicationSecurityGroups UpdateTags. */
+public final class ApplicationSecurityGroupsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ApplicationSecurityGroupUpdateTags.json
+ */
+ /**
+ * Sample code: Update application security group tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateApplicationSecurityGroupTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getApplicationSecurityGroups()
+ .updateTagsWithResponse(
+ "rg1", "test-asg", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableDelegationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableDelegationsListSamples.java
new file mode 100644
index 0000000000000..bdc4915a72292
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableDelegationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailableDelegations List. */
+public final class AvailableDelegationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AvailableDelegationsSubscriptionGet.json
+ */
+ /**
+ * Sample code: Get available delegations.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableDelegations(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAvailableDelegations().list("westcentralus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableEndpointServicesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableEndpointServicesListSamples.java
new file mode 100644
index 0000000000000..bd463d38ce56e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableEndpointServicesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailableEndpointServices List. */
+public final class AvailableEndpointServicesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/EndpointServicesList.json
+ */
+ /**
+ * Sample code: EndpointServicesList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void endpointServicesList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAvailableEndpointServices().list("westus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..321cc02455d19
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailablePrivateEndpointTypes ListByResourceGroup. */
+public final class AvailablePrivateEndpointTypesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AvailablePrivateEndpointTypesResourceGroupGet.json
+ */
+ /**
+ * Sample code: Get available PrivateEndpoint types in the resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailablePrivateEndpointTypesInTheResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAvailablePrivateEndpointTypes()
+ .listByResourceGroup("regionName", "rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailablePrivateEndpointTypesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailablePrivateEndpointTypesListSamples.java
new file mode 100644
index 0000000000000..81bc564b9ed58
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailablePrivateEndpointTypesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailablePrivateEndpointTypes List. */
+public final class AvailablePrivateEndpointTypesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AvailablePrivateEndpointTypesGet.json
+ */
+ /**
+ * Sample code: Get available PrivateEndpoint types.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailablePrivateEndpointTypes(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAvailablePrivateEndpointTypes().list("regionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableResourceGroupDelegationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableResourceGroupDelegationsListSamples.java
new file mode 100644
index 0000000000000..5085ec0ed3b68
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableResourceGroupDelegationsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailableResourceGroupDelegations List. */
+public final class AvailableResourceGroupDelegationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AvailableDelegationsResourceGroupGet.json
+ */
+ /**
+ * Sample code: Get available delegations in the resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableDelegationsInTheResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAvailableResourceGroupDelegations()
+ .list("westcentralus", "rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableServiceAliasesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableServiceAliasesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..13e8331c6045a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableServiceAliasesListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailableServiceAliases ListByResourceGroup. */
+public final class AvailableServiceAliasesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AvailableServiceAliasesListByResourceGroup.json
+ */
+ /**
+ * Sample code: Get available service aliases in the resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableServiceAliasesInTheResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAvailableServiceAliases()
+ .listByResourceGroup("rg1", "westcentralus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableServiceAliasesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableServiceAliasesListSamples.java
new file mode 100644
index 0000000000000..ff454c3daf573
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AvailableServiceAliasesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AvailableServiceAliases List. */
+public final class AvailableServiceAliasesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AvailableServiceAliasesList.json
+ */
+ /**
+ * Sample code: Get available service aliases.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAvailableServiceAliases(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAvailableServiceAliases().list("westcentralus", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallFqdnTagsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallFqdnTagsListSamples.java
new file mode 100644
index 0000000000000..89aba2cbef5da
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallFqdnTagsListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewallFqdnTags List. */
+public final class AzureFirewallFqdnTagsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallFqdnTagsListBySubscription.json
+ */
+ /**
+ * Sample code: List all Azure Firewall FQDN Tags for a given subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllAzureFirewallFQDNTagsForAGivenSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAzureFirewallFqdnTags().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..b4b6c8c21899e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsCreateOrUpdateSamples.java
@@ -0,0 +1,699 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.AzureFirewallInner;
+import com.azure.resourcemanager.network.models.AzureFirewallApplicationRule;
+import com.azure.resourcemanager.network.models.AzureFirewallApplicationRuleCollection;
+import com.azure.resourcemanager.network.models.AzureFirewallApplicationRuleProtocol;
+import com.azure.resourcemanager.network.models.AzureFirewallApplicationRuleProtocolType;
+import com.azure.resourcemanager.network.models.AzureFirewallIpConfiguration;
+import com.azure.resourcemanager.network.models.AzureFirewallNatRCAction;
+import com.azure.resourcemanager.network.models.AzureFirewallNatRCActionType;
+import com.azure.resourcemanager.network.models.AzureFirewallNatRule;
+import com.azure.resourcemanager.network.models.AzureFirewallNatRuleCollection;
+import com.azure.resourcemanager.network.models.AzureFirewallNetworkRule;
+import com.azure.resourcemanager.network.models.AzureFirewallNetworkRuleCollection;
+import com.azure.resourcemanager.network.models.AzureFirewallNetworkRuleProtocol;
+import com.azure.resourcemanager.network.models.AzureFirewallRCAction;
+import com.azure.resourcemanager.network.models.AzureFirewallRCActionType;
+import com.azure.resourcemanager.network.models.AzureFirewallSku;
+import com.azure.resourcemanager.network.models.AzureFirewallSkuName;
+import com.azure.resourcemanager.network.models.AzureFirewallSkuTier;
+import com.azure.resourcemanager.network.models.AzureFirewallThreatIntelMode;
+import com.azure.resourcemanager.network.models.HubIpAddresses;
+import com.azure.resourcemanager.network.models.HubPublicIpAddresses;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AzureFirewalls CreateOrUpdate. */
+public final class AzureFirewallsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallPutWithIpGroups.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With IpGroups.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAzureFirewallWithIpGroups(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .createOrUpdate(
+ "rg1",
+ "azurefirewall",
+ new AzureFirewallInner()
+ .withLocation("West US")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(
+ new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays
+ .asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription(
+ "Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku()
+ .withName(AzureFirewallSkuName.AZFW_VNET)
+ .withTier(AzureFirewallSkuTier.STANDARD)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallPutWithZones.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With Zones.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAzureFirewallWithZones(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .createOrUpdate(
+ "rg1",
+ "azurefirewall",
+ new AzureFirewallInner()
+ .withLocation("West US 2")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList("1", "2", "3"))
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(
+ new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays
+ .asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription(
+ "Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku()
+ .withName(AzureFirewallSkuName.AZFW_VNET)
+ .withTier(AzureFirewallSkuTier.STANDARD)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallPut.json
+ */
+ /**
+ * Sample code: Create Azure Firewall.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAzureFirewall(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .createOrUpdate(
+ "rg1",
+ "azurefirewall",
+ new AzureFirewallInner()
+ .withLocation("West US")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(
+ new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays
+ .asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription(
+ "Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku()
+ .withName(AzureFirewallSkuName.AZFW_VNET)
+ .withTier(AzureFirewallSkuTier.STANDARD)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallPutWithAdditionalProperties.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With Additional Properties.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAzureFirewallWithAdditionalProperties(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .createOrUpdate(
+ "rg1",
+ "azurefirewall",
+ new AzureFirewallInner()
+ .withLocation("West US")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(
+ new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays
+ .asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription(
+ "Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku()
+ .withName(AzureFirewallSkuName.AZFW_VNET)
+ .withTier(AzureFirewallSkuTier.STANDARD))
+ .withAdditionalProperties(mapOf("key1", "value1", "key2", "value2")),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallPutInHub.json
+ */
+ /**
+ * Sample code: Create Azure Firewall in virtual Hub.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAzureFirewallInVirtualHub(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .createOrUpdate(
+ "rg1",
+ "azurefirewall",
+ new AzureFirewallInner()
+ .withLocation("West US")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withVirtualHub(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"))
+ .withFirewallPolicy(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1"))
+ .withHubIpAddresses(
+ new HubIpAddresses()
+ .withPublicIPs(new HubPublicIpAddresses().withAddresses(Arrays.asList()).withCount(1)))
+ .withSku(
+ new AzureFirewallSku()
+ .withName(AzureFirewallSkuName.AZFW_HUB)
+ .withTier(AzureFirewallSkuTier.STANDARD)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallPutWithMgmtSubnet.json
+ */
+ /**
+ * Sample code: Create Azure Firewall With management subnet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createAzureFirewallWithManagementSubnet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .createOrUpdate(
+ "rg1",
+ "azurefirewall",
+ new AzureFirewallInner()
+ .withLocation("West US")
+ .withTags(mapOf("key1", "value1"))
+ .withZones(Arrays.asList())
+ .withApplicationRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleCollection()
+ .withName("apprulecoll")
+ .withPriority(110)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new AzureFirewallApplicationRuleProtocol()
+ .withProtocolType(
+ AzureFirewallApplicationRuleProtocolType.HTTPS)
+ .withPort(443)))
+ .withTargetFqdns(Arrays.asList("www.test.com"))))))
+ .withNatRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNatRuleCollection()
+ .withName("natrulecoll")
+ .withPriority(112)
+ .withAction(
+ new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTPS-traffic")
+ .withDescription("D-NAT all outbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("443"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedAddress("1.2.3.5")
+ .withTranslatedPort("8443"),
+ new AzureFirewallNatRule()
+ .withName("DNAT-HTTP-traffic-With-FQDN")
+ .withDescription("D-NAT all inbound web traffic for inspection")
+ .withSourceAddresses(Arrays.asList("*"))
+ .withDestinationAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationPorts(Arrays.asList("80"))
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withTranslatedPort("880")
+ .withTranslatedFqdn("internalhttpserver")))))
+ .withNetworkRuleCollections(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRuleCollection()
+ .withName("netrulecoll")
+ .withPriority(112)
+ .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic")
+ .withDescription("Block traffic based on source IPs and ports")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(
+ Arrays
+ .asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443")),
+ new AzureFirewallNetworkRule()
+ .withName("L4-traffic-with-FQDN")
+ .withDescription(
+ "Block traffic based on source IPs and ports to amazon")
+ .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255"))
+ .withDestinationPorts(Arrays.asList("443-444", "8443"))
+ .withDestinationFqdns(Arrays.asList("www.amazon.com"))))))
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"))))
+ .withManagementIpConfiguration(
+ new AzureFirewallIpConfiguration()
+ .withName("azureFirewallMgmtIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName")))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withSku(
+ new AzureFirewallSku()
+ .withName(AzureFirewallSkuName.AZFW_VNET)
+ .withTier(AzureFirewallSkuTier.STANDARD)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsDeleteSamples.java
new file mode 100644
index 0000000000000..fe51e9cb038cf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls Delete. */
+public final class AzureFirewallsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallDelete.json
+ */
+ /**
+ * Sample code: Delete Azure Firewall.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteAzureFirewall(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAzureFirewalls().delete("rg1", "azurefirewall", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..c22a3e9489b44
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsGetByResourceGroupSamples.java
@@ -0,0 +1,95 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls GetByResourceGroup. */
+public final class AzureFirewallsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallGetWithAdditionalProperties.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With Additional Properties.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAzureFirewallWithAdditionalProperties(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallGetWithIpGroups.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With IpGroups.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAzureFirewallWithIpGroups(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallGetWithZones.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With Zones.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAzureFirewallWithZones(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallGetWithMgmtSubnet.json
+ */
+ /**
+ * Sample code: Get Azure Firewall With management subnet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAzureFirewallWithManagementSubnet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallGet.json
+ */
+ /**
+ * Sample code: Get Azure Firewall.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getAzureFirewall(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .getByResourceGroupWithResponse("rg1", "azurefirewall", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..1b7e952f8572b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsListByResourceGroupSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls ListByResourceGroup. */
+public final class AzureFirewallsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Azure Firewalls for a given resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllAzureFirewallsForAGivenResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAzureFirewalls().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsListSamples.java
new file mode 100644
index 0000000000000..a3da5dd6a193a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for AzureFirewalls List. */
+public final class AzureFirewallsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallListBySubscription.json
+ */
+ /**
+ * Sample code: List all Azure Firewalls for a given subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllAzureFirewallsForAGivenSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getAzureFirewalls().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..25ca635ecf9a8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/AzureFirewallsUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for AzureFirewalls UpdateTags. */
+public final class AzureFirewallsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/AzureFirewallUpdateTags.json
+ */
+ /**
+ * Sample code: Update Azure Firewall Tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateAzureFirewallTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getAzureFirewalls()
+ .updateTags(
+ "azfwtest", "fw1", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..2ff7c5b55e932
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsCreateOrUpdateSamples.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.BastionHostInner;
+import com.azure.resourcemanager.network.models.BastionHostIpConfiguration;
+import java.util.Arrays;
+
+/** Samples for BastionHosts CreateOrUpdate. */
+public final class BastionHostsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/BastionHostPut.json
+ */
+ /**
+ * Sample code: Create Bastion Host.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createBastionHost(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getBastionHosts()
+ .createOrUpdate(
+ "rg1",
+ "bastionhosttenant",
+ new BastionHostInner()
+ .withIpConfigurations(
+ Arrays
+ .asList(
+ new BastionHostIpConfiguration()
+ .withName("bastionHostIpConfiguration")
+ .withSubnet(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"))
+ .withPublicIpAddress(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsDeleteSamples.java
new file mode 100644
index 0000000000000..0e09a1fde08b4
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts Delete. */
+public final class BastionHostsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/BastionHostDelete.json
+ */
+ /**
+ * Sample code: Delete Bastion Host.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteBastionHost(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getBastionHosts().delete("rg1", "bastionhosttenant", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..9a1e33f1c2020
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts GetByResourceGroup. */
+public final class BastionHostsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/BastionHostGet.json
+ */
+ /**
+ * Sample code: Get Bastion Host.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getBastionHost(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getBastionHosts()
+ .getByResourceGroupWithResponse("rg1", "bastionhosttenant'", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..64fdef6247efa
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts ListByResourceGroup. */
+public final class BastionHostsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/BastionHostListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Bastion Hosts for a given resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllBastionHostsForAGivenResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getBastionHosts().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsListSamples.java
new file mode 100644
index 0000000000000..d5285e775aaae
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for BastionHosts List. */
+public final class BastionHostsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/BastionHostListBySubscription.json
+ */
+ /**
+ * Sample code: List all Bastion Hosts for a given subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllBastionHostsForAGivenSubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getBastionHosts().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..305cb73aa3d39
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BastionHostsUpdateTagsSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for BastionHosts UpdateTags. */
+public final class BastionHostsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/BastionHostPatch.json
+ */
+ /**
+ * Sample code: Patch Bastion Host.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void patchBastionHost(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getBastionHosts()
+ .updateTags(
+ "rg1",
+ "bastionhosttenant",
+ new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BgpServiceCommunitiesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BgpServiceCommunitiesListSamples.java
new file mode 100644
index 0000000000000..43bbe307f66c5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/BgpServiceCommunitiesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for BgpServiceCommunities List. */
+public final class BgpServiceCommunitiesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ServiceCommunityList.json
+ */
+ /**
+ * Sample code: ServiceCommunityList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void serviceCommunityList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getBgpServiceCommunities().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..a769b5bc19bb0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsCreateOrUpdateSamples.java
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ConnectionMonitorInner;
+import com.azure.resourcemanager.network.models.ConnectionMonitorEndpoint;
+import com.azure.resourcemanager.network.models.ConnectionMonitorEndpointFilter;
+import com.azure.resourcemanager.network.models.ConnectionMonitorEndpointFilterItem;
+import com.azure.resourcemanager.network.models.ConnectionMonitorEndpointFilterItemType;
+import com.azure.resourcemanager.network.models.ConnectionMonitorEndpointFilterType;
+import com.azure.resourcemanager.network.models.ConnectionMonitorTcpConfiguration;
+import com.azure.resourcemanager.network.models.ConnectionMonitorTestConfiguration;
+import com.azure.resourcemanager.network.models.ConnectionMonitorTestConfigurationProtocol;
+import com.azure.resourcemanager.network.models.ConnectionMonitorTestGroup;
+import java.util.Arrays;
+
+/** Samples for ConnectionMonitors CreateOrUpdate. */
+public final class ConnectionMonitorsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorCreate.json
+ */
+ /**
+ * Sample code: Create connection monitor V1.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createConnectionMonitorV1(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getConnectionMonitors()
+ .createOrUpdate(
+ "rg1",
+ "nw1",
+ "cm1",
+ new ConnectionMonitorInner()
+ .withLocation("eastus")
+ .withEndpoints(
+ Arrays
+ .asList(
+ new ConnectionMonitorEndpoint()
+ .withName("source")
+ .withResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"),
+ new ConnectionMonitorEndpoint().withName("destination").withAddress("bing.com")))
+ .withTestConfigurations(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestConfiguration()
+ .withName("tcp")
+ .withTestFrequencySec(60)
+ .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP)
+ .withTcpConfiguration(new ConnectionMonitorTcpConfiguration().withPort(80))))
+ .withTestGroups(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestGroup()
+ .withName("tg")
+ .withTestConfigurations(Arrays.asList("tcp"))
+ .withSources(Arrays.asList("source"))
+ .withDestinations(Arrays.asList("destination")))),
+ null,
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorV2Create.json
+ */
+ /**
+ * Sample code: Create connection monitor V2.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createConnectionMonitorV2(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getConnectionMonitors()
+ .createOrUpdate(
+ "rg1",
+ "nw1",
+ "cm1",
+ new ConnectionMonitorInner()
+ .withEndpoints(
+ Arrays
+ .asList(
+ new ConnectionMonitorEndpoint()
+ .withName("vm1")
+ .withResourceId(
+ "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"),
+ new ConnectionMonitorEndpoint()
+ .withName("CanaryWorkspaceVamshi")
+ .withResourceId(
+ "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace")
+ .withFilter(
+ new ConnectionMonitorEndpointFilter()
+ .withType(ConnectionMonitorEndpointFilterType.INCLUDE)
+ .withItems(
+ Arrays
+ .asList(
+ new ConnectionMonitorEndpointFilterItem()
+ .withType(
+ ConnectionMonitorEndpointFilterItemType.AGENT_ADDRESS)
+ .withAddress("npmuser")))),
+ new ConnectionMonitorEndpoint().withName("bing").withAddress("bing.com"),
+ new ConnectionMonitorEndpoint().withName("google").withAddress("google.com")))
+ .withTestConfigurations(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestConfiguration()
+ .withName("testConfig1")
+ .withTestFrequencySec(60)
+ .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP)
+ .withTcpConfiguration(
+ new ConnectionMonitorTcpConfiguration()
+ .withPort(80)
+ .withDisableTraceRoute(false))))
+ .withTestGroups(
+ Arrays
+ .asList(
+ new ConnectionMonitorTestGroup()
+ .withName("test1")
+ .withDisable(false)
+ .withTestConfigurations(Arrays.asList("testConfig1"))
+ .withSources(Arrays.asList("vm1", "CanaryWorkspaceVamshi"))
+ .withDestinations(Arrays.asList("bing", "google"))))
+ .withOutputs(Arrays.asList()),
+ null,
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsDeleteSamples.java
new file mode 100644
index 0000000000000..bd9c5884f2d4e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Delete. */
+public final class ConnectionMonitorsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorDelete.json
+ */
+ /**
+ * Sample code: Delete connection monitor.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteConnectionMonitor(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getConnectionMonitors().delete("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsGetSamples.java
new file mode 100644
index 0000000000000..e5784f547dc46
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Get. */
+public final class ConnectionMonitorsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorGet.json
+ */
+ /**
+ * Sample code: Get connection monitor.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getConnectionMonitor(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getConnectionMonitors()
+ .getWithResponse("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsListSamples.java
new file mode 100644
index 0000000000000..7e697d91533e3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors List. */
+public final class ConnectionMonitorsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorList.json
+ */
+ /**
+ * Sample code: List connection monitors.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listConnectionMonitors(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getConnectionMonitors().list("rg1", "nw1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsQuerySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsQuerySamples.java
new file mode 100644
index 0000000000000..ded82e01286bd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsQuerySamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Query. */
+public final class ConnectionMonitorsQuerySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorQuery.json
+ */
+ /**
+ * Sample code: Query connection monitor.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void queryConnectionMonitor(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getConnectionMonitors().query("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsStartSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsStartSamples.java
new file mode 100644
index 0000000000000..6ed47ec39b7dd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsStartSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Start. */
+public final class ConnectionMonitorsStartSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorStart.json
+ */
+ /**
+ * Sample code: Start connection monitor.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void startConnectionMonitor(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getConnectionMonitors().start("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsStopSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsStopSamples.java
new file mode 100644
index 0000000000000..22f13f4df5871
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsStopSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ConnectionMonitors Stop. */
+public final class ConnectionMonitorsStopSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorStop.json
+ */
+ /**
+ * Sample code: Stop connection monitor.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void stopConnectionMonitor(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getConnectionMonitors().stop("rg1", "nw1", "cm1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..557c0916b03ae
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ConnectionMonitorsUpdateTagsSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ConnectionMonitors UpdateTags. */
+public final class ConnectionMonitorsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherConnectionMonitorUpdateTags.json
+ */
+ /**
+ * Sample code: Update connection monitor tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateConnectionMonitorTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getConnectionMonitors()
+ .updateTagsWithResponse(
+ "rg1",
+ "nw1",
+ "cm1",
+ new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..8e22bbafd0338
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesCreateOrUpdateSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.CustomIpPrefixInner;
+
+/** Samples for CustomIpPrefixes CreateOrUpdate. */
+public final class CustomIpPrefixesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/CustomIpPrefixCreateCustomizedValues.json
+ */
+ /**
+ * Sample code: Create custom IP prefix allocation method.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createCustomIPPrefixAllocationMethod(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getCustomIpPrefixes()
+ .createOrUpdate(
+ "rg1",
+ "test-customipprefix",
+ new CustomIpPrefixInner().withLocation("westus").withCidr("0.0.0.0/24"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesDeleteSamples.java
new file mode 100644
index 0000000000000..19bdcf5706c27
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes Delete. */
+public final class CustomIpPrefixesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/CustomIpPrefixDelete.json
+ */
+ /**
+ * Sample code: Delete custom IP prefix.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteCustomIPPrefix(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getCustomIpPrefixes()
+ .delete("rg1", "test-customipprefix", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..e390cfe76c82a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes GetByResourceGroup. */
+public final class CustomIpPrefixesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/CustomIpPrefixGet.json
+ */
+ /**
+ * Sample code: Get custom IP prefix.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getCustomIPPrefix(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getCustomIpPrefixes()
+ .getByResourceGroupWithResponse("rg1", "test-customipprefix", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..d020bb5790a16
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes ListByResourceGroup. */
+public final class CustomIpPrefixesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/CustomIpPrefixList.json
+ */
+ /**
+ * Sample code: List resource group Custom IP prefixes.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listResourceGroupCustomIPPrefixes(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getCustomIpPrefixes().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesListSamples.java
new file mode 100644
index 0000000000000..10daf658da243
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for CustomIpPrefixes List. */
+public final class CustomIpPrefixesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/CustomIpPrefixListAll.json
+ */
+ /**
+ * Sample code: List all custom IP prefixes.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllCustomIPPrefixes(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getCustomIpPrefixes().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesUpdateTagsSamples.java
new file mode 100644
index 0000000000000..f2ebd53cc51e1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/CustomIpPrefixesUpdateTagsSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for CustomIpPrefixes UpdateTags. */
+public final class CustomIpPrefixesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/CustomIpPrefixUpdateTags.json
+ */
+ /**
+ * Sample code: Update public IP address tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updatePublicIPAddressTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getCustomIpPrefixes()
+ .updateTagsWithResponse(
+ "rg1",
+ "test-customipprefix",
+ new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..78de080794236
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesCreateOrUpdateSamples.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.DdosCustomPolicyInner;
+import com.azure.resourcemanager.network.models.DdosCustomPolicyProtocol;
+import com.azure.resourcemanager.network.models.ProtocolCustomSettingsFormat;
+import java.util.Arrays;
+
+/** Samples for DdosCustomPolicies CreateOrUpdate. */
+public final class DdosCustomPoliciesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosCustomPolicyCreate.json
+ */
+ /**
+ * Sample code: Create DDoS custom policy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createDDoSCustomPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosCustomPolicies()
+ .createOrUpdate(
+ "rg1",
+ "test-ddos-custom-policy",
+ new DdosCustomPolicyInner()
+ .withLocation("centraluseuap")
+ .withProtocolCustomSettings(
+ Arrays.asList(new ProtocolCustomSettingsFormat().withProtocol(DdosCustomPolicyProtocol.TCP))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesDeleteSamples.java
new file mode 100644
index 0000000000000..564e90d3414e1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DdosCustomPolicies Delete. */
+public final class DdosCustomPoliciesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosCustomPolicyDelete.json
+ */
+ /**
+ * Sample code: Delete DDoS custom policy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteDDoSCustomPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosCustomPolicies()
+ .delete("rg1", "test-ddos-custom-policy", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..94acfd451bcb6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DdosCustomPolicies GetByResourceGroup. */
+public final class DdosCustomPoliciesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosCustomPolicyGet.json
+ */
+ /**
+ * Sample code: Get DDoS custom policy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getDDoSCustomPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosCustomPolicies()
+ .getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesUpdateTagsSamples.java
new file mode 100644
index 0000000000000..322a5abdbca07
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosCustomPoliciesUpdateTagsSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DdosCustomPolicies UpdateTags. */
+public final class DdosCustomPoliciesUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosCustomPolicyUpdateTags.json
+ */
+ /**
+ * Sample code: DDoS Custom policy Update tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void dDoSCustomPolicyUpdateTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosCustomPolicies()
+ .updateTagsWithResponse(
+ "rg1",
+ "test-ddos-custom-policy",
+ new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..6f7d87322f421
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansCreateOrUpdateSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.DdosProtectionPlanInner;
+
+/** Samples for DdosProtectionPlans CreateOrUpdate. */
+public final class DdosProtectionPlansCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosProtectionPlanCreate.json
+ */
+ /**
+ * Sample code: Create DDoS protection plan.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createDDoSProtectionPlan(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosProtectionPlans()
+ .createOrUpdate("rg1", "test-plan", new DdosProtectionPlanInner().withLocation("westus"), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansDeleteSamples.java
new file mode 100644
index 0000000000000..41fb8aff2e89d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans Delete. */
+public final class DdosProtectionPlansDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosProtectionPlanDelete.json
+ */
+ /**
+ * Sample code: Delete DDoS protection plan.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteDDoSProtectionPlan(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDdosProtectionPlans().delete("rg1", "test-plan", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..be9d75af07240
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans GetByResourceGroup. */
+public final class DdosProtectionPlansGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosProtectionPlanGet.json
+ */
+ /**
+ * Sample code: Get DDoS protection plan.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getDDoSProtectionPlan(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosProtectionPlans()
+ .getByResourceGroupWithResponse("rg1", "test-plan", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..d91329ce65ee9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans ListByResourceGroup. */
+public final class DdosProtectionPlansListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosProtectionPlanList.json
+ */
+ /**
+ * Sample code: List DDoS protection plans in resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listDDoSProtectionPlansInResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDdosProtectionPlans().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansListSamples.java
new file mode 100644
index 0000000000000..7a19532fc3316
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DdosProtectionPlans List. */
+public final class DdosProtectionPlansListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosProtectionPlanListAll.json
+ */
+ /**
+ * Sample code: List all DDoS protection plans.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllDDoSProtectionPlans(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDdosProtectionPlans().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansUpdateTagsSamples.java
new file mode 100644
index 0000000000000..a21edcba96fbb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DdosProtectionPlansUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for DdosProtectionPlans UpdateTags. */
+public final class DdosProtectionPlansUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DdosProtectionPlanUpdateTags.json
+ */
+ /**
+ * Sample code: DDoS protection plan Update tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void dDoSProtectionPlanUpdateTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDdosProtectionPlans()
+ .updateTagsWithResponse(
+ "rg1", "test-plan", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DefaultSecurityRulesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DefaultSecurityRulesGetSamples.java
new file mode 100644
index 0000000000000..03923cd1f8f94
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DefaultSecurityRulesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DefaultSecurityRules Get. */
+public final class DefaultSecurityRulesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DefaultSecurityRuleGet.json
+ */
+ /**
+ * Sample code: DefaultSecurityRuleGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void defaultSecurityRuleGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDefaultSecurityRules()
+ .getWithResponse("testrg", "nsg1", "AllowVnetInBound", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DefaultSecurityRulesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DefaultSecurityRulesListSamples.java
new file mode 100644
index 0000000000000..51601a3a85e51
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DefaultSecurityRulesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DefaultSecurityRules List. */
+public final class DefaultSecurityRulesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DefaultSecurityRuleList.json
+ */
+ /**
+ * Sample code: DefaultSecurityRuleList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void defaultSecurityRuleList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDefaultSecurityRules().list("testrg", "nsg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..d627e21684c1a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationCreateOrUpdateSamples.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.DscpConfigurationInner;
+import com.azure.resourcemanager.network.models.ProtocolType;
+import com.azure.resourcemanager.network.models.QosDefinition;
+import com.azure.resourcemanager.network.models.QosIpRange;
+import com.azure.resourcemanager.network.models.QosPortRange;
+import java.util.Arrays;
+
+/** Samples for DscpConfiguration CreateOrUpdate. */
+public final class DscpConfigurationCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DscpConfigurationCreate.json
+ */
+ /**
+ * Sample code: Create DSCP Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createDSCPConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDscpConfigurations()
+ .createOrUpdate(
+ "rg1",
+ "mydscpconfig",
+ new DscpConfigurationInner()
+ .withLocation("eastus")
+ .withQosDefinitionCollection(
+ Arrays
+ .asList(
+ new QosDefinition()
+ .withMarkings(Arrays.asList(1))
+ .withSourceIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("127.0.0.1").withEndIp("127.0.0.2")))
+ .withDestinationIpRanges(
+ Arrays
+ .asList(new QosIpRange().withStartIp("127.0.10.1").withEndIp("127.0.10.2")))
+ .withSourcePortRanges(
+ Arrays
+ .asList(
+ new QosPortRange().withStart(10).withEnd(11),
+ new QosPortRange().withStart(20).withEnd(21)))
+ .withDestinationPortRanges(
+ Arrays.asList(new QosPortRange().withStart(15).withEnd(15)))
+ .withProtocol(ProtocolType.TCP),
+ new QosDefinition()
+ .withMarkings(Arrays.asList(2))
+ .withSourceIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("12.0.0.1").withEndIp("12.0.0.2")))
+ .withDestinationIpRanges(
+ Arrays.asList(new QosIpRange().withStartIp("12.0.10.1").withEndIp("12.0.10.2")))
+ .withSourcePortRanges(Arrays.asList(new QosPortRange().withStart(11).withEnd(12)))
+ .withDestinationPortRanges(
+ Arrays.asList(new QosPortRange().withStart(51).withEnd(52)))
+ .withProtocol(ProtocolType.UDP))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationDeleteSamples.java
new file mode 100644
index 0000000000000..6f41704aee059
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration Delete. */
+public final class DscpConfigurationDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DscpConfigurationDelete.json
+ */
+ /**
+ * Sample code: Delete DSCP Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteDSCPConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDscpConfigurations().delete("rg1", "mydscpConfig", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..c6e93d15db8bc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration GetByResourceGroup. */
+public final class DscpConfigurationGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DscpConfigurationGet.json
+ */
+ /**
+ * Sample code: Get Dscp Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getDscpConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getDscpConfigurations()
+ .getByResourceGroupWithResponse("rg1", "mydscpConfig", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..91e1716f4e360
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration ListByResourceGroup. */
+public final class DscpConfigurationListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DscpConfigurationList.json
+ */
+ /**
+ * Sample code: Get Dscp Configuration.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getDscpConfiguration(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDscpConfigurations().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationListSamples.java
new file mode 100644
index 0000000000000..6e7b646ff8675
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/DscpConfigurationListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for DscpConfiguration List. */
+public final class DscpConfigurationListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/DscpConfigurationListAll.json
+ */
+ /**
+ * Sample code: List all network interfaces.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllNetworkInterfaces(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getDscpConfigurations().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..e24e4a6cdbc19
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitAuthorizationInner;
+
+/** Samples for ExpressRouteCircuitAuthorizations CreateOrUpdate. */
+public final class ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitAuthorizationCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit Authorization.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createExpressRouteCircuitAuthorization(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitAuthorizations()
+ .createOrUpdate(
+ "rg1", "circuitName", "authorizatinName", new ExpressRouteCircuitAuthorizationInner(), Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.java
new file mode 100644
index 0000000000000..26d3821eb2ddb
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitAuthorizations Delete. */
+public final class ExpressRouteCircuitAuthorizationsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitAuthorizationDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit Authorization.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteExpressRouteCircuitAuthorization(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitAuthorizations()
+ .delete("rg1", "circuitName", "authorizationName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsGetSamples.java
new file mode 100644
index 0000000000000..268dd8d36f16e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitAuthorizations Get. */
+public final class ExpressRouteCircuitAuthorizationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitAuthorizationGet.json
+ */
+ /**
+ * Sample code: Get ExpressRouteCircuit Authorization.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCircuitAuthorization(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitAuthorizations()
+ .getWithResponse("rg1", "circuitName", "authorizationName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsListSamples.java
new file mode 100644
index 0000000000000..7971a6bef2ab5
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitAuthorizationsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitAuthorizations List. */
+public final class ExpressRouteCircuitAuthorizationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitAuthorizationList.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuit Authorization.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExpressRouteCircuitAuthorization(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitAuthorizations()
+ .list("rg1", "circuitName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..84b2232a06ab6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitConnectionInner;
+import com.azure.resourcemanager.network.models.Ipv6CircuitConnectionConfig;
+
+/** Samples for ExpressRouteCircuitConnections CreateOrUpdate. */
+public final class ExpressRouteCircuitConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitConnectionCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteCircuitConnectionCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteCircuitConnectionCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitConnections()
+ .createOrUpdate(
+ "rg1",
+ "ExpressRouteARMCircuitA",
+ "AzurePrivatePeering",
+ "circuitConnectionUSAUS",
+ new ExpressRouteCircuitConnectionInner()
+ .withExpressRouteCircuitPeering(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering"))
+ .withPeerExpressRouteCircuitPeering(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering"))
+ .withAddressPrefix("10.0.0.0/29")
+ .withAuthorizationKey("946a1918-b7a2-4917-b43c-8c4cdaee006a")
+ .withIpv6CircuitConnectionConfig(
+ new Ipv6CircuitConnectionConfig().withAddressPrefix("aa:bb::/125")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..c4eb697dc4c43
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitConnections Delete. */
+public final class ExpressRouteCircuitConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitConnectionDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteExpressRouteCircuit(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitConnections()
+ .delete("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsGetSamples.java
new file mode 100644
index 0000000000000..12340f68a09b0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitConnections Get. */
+public final class ExpressRouteCircuitConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitConnectionGet.json
+ */
+ /**
+ * Sample code: ExpressRouteCircuitConnectionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteCircuitConnectionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitConnections()
+ .getWithResponse(
+ "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsListSamples.java
new file mode 100644
index 0000000000000..bca22c973f3e3
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitConnectionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitConnections List. */
+public final class ExpressRouteCircuitConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitConnectionList.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuit Connection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExpressRouteCircuitConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitConnections()
+ .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..2ab4eb37fad56
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitPeeringInner;
+
+/** Samples for ExpressRouteCircuitPeerings CreateOrUpdate. */
+public final class ExpressRouteCircuitPeeringsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitPeeringCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit Peerings.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createExpressRouteCircuitPeerings(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitPeerings()
+ .createOrUpdate(
+ "rg1",
+ "circuitName",
+ "AzurePrivatePeering",
+ new ExpressRouteCircuitPeeringInner()
+ .withPeerAsn(200L)
+ .withPrimaryPeerAddressPrefix("192.168.16.252/30")
+ .withSecondaryPeerAddressPrefix("192.168.18.252/30")
+ .withVlanId(200),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsDeleteSamples.java
new file mode 100644
index 0000000000000..8ea64a5331d49
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitPeerings Delete. */
+public final class ExpressRouteCircuitPeeringsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitPeeringDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit Peerings.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteExpressRouteCircuitPeerings(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitPeerings()
+ .delete("rg1", "circuitName", "peeringName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsGetSamples.java
new file mode 100644
index 0000000000000..68426dde26b47
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitPeerings Get. */
+public final class ExpressRouteCircuitPeeringsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitPeeringGet.json
+ */
+ /**
+ * Sample code: Get ExpressRouteCircuit Peering.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCircuitPeering(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitPeerings()
+ .getWithResponse("rg1", "circuitName", "MicrosoftPeering", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsListSamples.java
new file mode 100644
index 0000000000000..63f6c72f3aca7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitPeeringsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuitPeerings List. */
+public final class ExpressRouteCircuitPeeringsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitPeeringList.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuit Peerings.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExpressRouteCircuitPeerings(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuitPeerings()
+ .list("rg1", "circuitName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..9e642f6c56650
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsCreateOrUpdateSamples.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteCircuitInner;
+import com.azure.resourcemanager.network.models.ExpressRouteCircuitServiceProviderProperties;
+import com.azure.resourcemanager.network.models.ExpressRouteCircuitSku;
+import com.azure.resourcemanager.network.models.ExpressRouteCircuitSkuFamily;
+import com.azure.resourcemanager.network.models.ExpressRouteCircuitSkuTier;
+import java.util.Arrays;
+
+/** Samples for ExpressRouteCircuits CreateOrUpdate. */
+public final class ExpressRouteCircuitsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitCreate.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createExpressRouteCircuit(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .createOrUpdate(
+ "rg1",
+ "circuitName",
+ new ExpressRouteCircuitInner()
+ .withLocation("Brazil South")
+ .withSku(
+ new ExpressRouteCircuitSku()
+ .withName("Standard_MeteredData")
+ .withTier(ExpressRouteCircuitSkuTier.STANDARD)
+ .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA))
+ .withAllowClassicOperations(false)
+ .withAuthorizations(Arrays.asList())
+ .withPeerings(Arrays.asList())
+ .withServiceProviderProperties(
+ new ExpressRouteCircuitServiceProviderProperties()
+ .withServiceProviderName("Equinix")
+ .withPeeringLocation("Silicon Valley")
+ .withBandwidthInMbps(200)),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json
+ */
+ /**
+ * Sample code: Create ExpressRouteCircuit on ExpressRoutePort.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createExpressRouteCircuitOnExpressRoutePort(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .createOrUpdate(
+ "rg1",
+ "expressRouteCircuit1",
+ new ExpressRouteCircuitInner()
+ .withLocation("westus")
+ .withSku(
+ new ExpressRouteCircuitSku()
+ .withName("Premium_MeteredData")
+ .withTier(ExpressRouteCircuitSkuTier.PREMIUM)
+ .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA))
+ .withExpressRoutePort(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName"))
+ .withBandwidthInGbps(10.0f),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsDeleteSamples.java
new file mode 100644
index 0000000000000..940454c59167d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits Delete. */
+public final class ExpressRouteCircuitsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitDelete.json
+ */
+ /**
+ * Sample code: Delete ExpressRouteCircuit.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteExpressRouteCircuit(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRouteCircuits().delete("rg1", "circuitName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..9ae8bedea0e39
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits GetByResourceGroup. */
+public final class ExpressRouteCircuitsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitGet.json
+ */
+ /**
+ * Sample code: Get ExpressRouteCircuit.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCircuit(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .getByResourceGroupWithResponse("rg1", "circuitName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetPeeringStatsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetPeeringStatsSamples.java
new file mode 100644
index 0000000000000..801aa86933c1f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetPeeringStatsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits GetPeeringStats. */
+public final class ExpressRouteCircuitsGetPeeringStatsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitPeeringStats.json
+ */
+ /**
+ * Sample code: Get ExpressRoute Circuit Peering Traffic Stats.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCircuitPeeringTrafficStats(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .getPeeringStatsWithResponse("rg1", "circuitName", "peeringName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetStatsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetStatsSamples.java
new file mode 100644
index 0000000000000..cabe47112630c
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsGetStatsSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits GetStats. */
+public final class ExpressRouteCircuitsGetStatsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitStats.json
+ */
+ /**
+ * Sample code: Get ExpressRoute Circuit Traffic Stats.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCircuitTrafficStats(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .getStatsWithResponse("rg1", "circuitName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListArpTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListArpTableSamples.java
new file mode 100644
index 0000000000000..5ff348dab5b26
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListArpTableSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListArpTable. */
+public final class ExpressRouteCircuitsListArpTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitARPTableList.json
+ */
+ /**
+ * Sample code: List ARP Table.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listARPTable(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .listArpTable("rg1", "circuitName", "peeringName", "devicePath", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..bdda97a1e8a35
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListByResourceGroup. */
+public final class ExpressRouteCircuitsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitListByResourceGroup.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuits in a resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExpressRouteCircuitsInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRouteCircuits().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListRoutesTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListRoutesTableSamples.java
new file mode 100644
index 0000000000000..50e583f8506a1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListRoutesTableSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListRoutesTable. */
+public final class ExpressRouteCircuitsListRoutesTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitRouteTableList.json
+ */
+ /**
+ * Sample code: List Route Tables.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listRouteTables(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .listRoutesTable("rg1", "circuitName", "peeringName", "devicePath", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.java
new file mode 100644
index 0000000000000..4b78621404fd0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits ListRoutesTableSummary. */
+public final class ExpressRouteCircuitsListRoutesTableSummarySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitRouteTableSummaryList.json
+ */
+ /**
+ * Sample code: List Route Table Summary.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listRouteTableSummary(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .listRoutesTableSummary("rg1", "circuitName", "peeringName", "devicePath", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListSamples.java
new file mode 100644
index 0000000000000..b00a48bf594ea
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCircuits List. */
+public final class ExpressRouteCircuitsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitListBySubscription.json
+ */
+ /**
+ * Sample code: List ExpressRouteCircuits in a subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExpressRouteCircuitsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRouteCircuits().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..56572adc811ba
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCircuitsUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRouteCircuits UpdateTags. */
+public final class ExpressRouteCircuitsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCircuitUpdateTags.json
+ */
+ /**
+ * Sample code: Update Express Route Circuit Tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateExpressRouteCircuitTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCircuits()
+ .updateTagsWithResponse(
+ "ertest", "er1", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..66b15984667bf
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsCreateOrUpdateSamples.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteConnectionInner;
+import com.azure.resourcemanager.network.models.ExpressRouteCircuitPeeringId;
+
+/** Samples for ExpressRouteConnections CreateOrUpdate. */
+public final class ExpressRouteConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteConnectionCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteConnectionCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteConnections()
+ .createOrUpdate(
+ "resourceGroupName",
+ "gateway-2",
+ "connectionName",
+ new ExpressRouteConnectionInner()
+ .withId(
+ "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName")
+ .withName("connectionName")
+ .withExpressRouteCircuitPeering(
+ new ExpressRouteCircuitPeeringId()
+ .withId(
+ "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering"))
+ .withAuthorizationKey("authorizationKey")
+ .withRoutingWeight(2),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsDeleteSamples.java
new file mode 100644
index 0000000000000..54dc98b66ea76
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteConnections Delete. */
+public final class ExpressRouteConnectionsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteConnectionDelete.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteConnectionDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteConnections()
+ .delete("resourceGroupName", "expressRouteGatewayName", "connectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsGetSamples.java
new file mode 100644
index 0000000000000..bbd2d653bc928
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteConnections Get. */
+public final class ExpressRouteConnectionsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteConnectionGet.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteConnectionGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteConnections()
+ .getWithResponse("resourceGroupName", "expressRouteGatewayName", "connectionName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsListSamples.java
new file mode 100644
index 0000000000000..91fec74164f18
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteConnectionsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteConnections List. */
+public final class ExpressRouteConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteConnectionList.json
+ */
+ /**
+ * Sample code: ExpressRouteConnectionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteConnectionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteConnections()
+ .listWithResponse("resourceGroupName", "expressRouteGatewayName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..9c71397a6c86d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionPeeringInner;
+import com.azure.resourcemanager.network.models.Ipv6ExpressRouteCircuitPeeringConfig;
+
+/** Samples for ExpressRouteCrossConnectionPeerings CreateOrUpdate. */
+public final class ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionBgpPeeringCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionBgpPeeringCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteCrossConnectionBgpPeeringCreate(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnectionPeerings()
+ .createOrUpdate(
+ "CrossConnection-SiliconValley",
+ "",
+ "AzurePrivatePeering",
+ new ExpressRouteCrossConnectionPeeringInner()
+ .withPeerAsn(200L)
+ .withPrimaryPeerAddressPrefix("192.168.16.252/30")
+ .withSecondaryPeerAddressPrefix("192.168.18.252/30")
+ .withVlanId(200)
+ .withIpv6PeeringConfig(
+ new Ipv6ExpressRouteCircuitPeeringConfig()
+ .withPrimaryPeerAddressPrefix("3FFE:FFFF:0:CD30::/126")
+ .withSecondaryPeerAddressPrefix("3FFE:FFFF:0:CD30::4/126")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.java
new file mode 100644
index 0000000000000..cec8e0c821d8e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnectionPeerings Delete. */
+public final class ExpressRouteCrossConnectionPeeringsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionBgpPeeringDelete.json
+ */
+ /**
+ * Sample code: DeleteExpressRouteCrossConnectionBgpPeering.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteExpressRouteCrossConnectionBgpPeering(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnectionPeerings()
+ .delete("CrossConnection-SiliconValley", "", "AzurePrivatePeering", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java
new file mode 100644
index 0000000000000..3478ad941a312
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnectionPeerings Get. */
+public final class ExpressRouteCrossConnectionPeeringsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionBgpPeeringGet.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionBgpPeering.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCrossConnectionBgpPeering(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnectionPeerings()
+ .getWithResponse(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsListSamples.java
new file mode 100644
index 0000000000000..837f86b7ae24a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionPeeringsListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnectionPeerings List. */
+public final class ExpressRouteCrossConnectionPeeringsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionBgpPeeringList.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionBgpPeeringList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteCrossConnectionBgpPeeringList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnectionPeerings()
+ .list("CrossConnection-SiliconValley", "", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..cdf977450698e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteCrossConnectionInner;
+import com.azure.resourcemanager.network.models.ServiceProviderProvisioningState;
+
+/** Samples for ExpressRouteCrossConnections CreateOrUpdate. */
+public final class ExpressRouteCrossConnectionsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionUpdate.json
+ */
+ /**
+ * Sample code: UpdateExpressRouteCrossConnection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateExpressRouteCrossConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .createOrUpdate(
+ "CrossConnection-SiliconValley",
+ "",
+ new ExpressRouteCrossConnectionInner()
+ .withServiceProviderProvisioningState(ServiceProviderProvisioningState.NOT_PROVISIONED),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..236332dbd9c2a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections GetByResourceGroup. */
+public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionGet.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnection.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCrossConnection(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListArpTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListArpTableSamples.java
new file mode 100644
index 0000000000000..a38f75cb88536
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListArpTableSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListArpTable. */
+public final class ExpressRouteCrossConnectionsListArpTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionsArpTable.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionsArpTable.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCrossConnectionsArpTable(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .listArpTable(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..3df6cce844c32
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListByResourceGroup. */
+public final class ExpressRouteCrossConnectionsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionListByResourceGroup.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteCrossConnectionListByResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .listByResourceGroup("CrossConnection-SiliconValley", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java
new file mode 100644
index 0000000000000..47b691bc74dc0
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListRoutesTable. */
+public final class ExpressRouteCrossConnectionsListRoutesTableSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionsRouteTable.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionsRouteTable.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCrossConnectionsRouteTable(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .listRoutesTable(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java
new file mode 100644
index 0000000000000..3b54ed6ac652b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections ListRoutesTableSummary. */
+public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionsRouteTableSummary.json
+ */
+ /**
+ * Sample code: GetExpressRouteCrossConnectionsRouteTableSummary.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getExpressRouteCrossConnectionsRouteTableSummary(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .listRoutesTableSummary(
+ "CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListSamples.java
new file mode 100644
index 0000000000000..1e68f48fa76e8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteCrossConnections List. */
+public final class ExpressRouteCrossConnectionsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionList.json
+ */
+ /**
+ * Sample code: ExpressRouteCrossConnectionList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteCrossConnectionList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRouteCrossConnections().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..1b01e60020a9f
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRouteCrossConnections UpdateTags. */
+public final class ExpressRouteCrossConnectionsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteCrossConnectionUpdateTags.json
+ */
+ /**
+ * Sample code: UpdateExpressRouteCrossConnectionTags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateExpressRouteCrossConnectionTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteCrossConnections()
+ .updateTagsWithResponse(
+ "CrossConnection-SiliconValley",
+ "",
+ new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..fe17fd5289425
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysCreateOrUpdateSamples.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteGatewayInner;
+import com.azure.resourcemanager.network.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration;
+import com.azure.resourcemanager.network.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds;
+import com.azure.resourcemanager.network.models.VirtualHubId;
+
+/** Samples for ExpressRouteGateways CreateOrUpdate. */
+public final class ExpressRouteGatewaysCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteGatewayCreate.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteGatewayCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteGateways()
+ .createOrUpdate(
+ "resourceGroupName",
+ "gateway-2",
+ new ExpressRouteGatewayInner()
+ .withLocation("westus")
+ .withAutoScaleConfiguration(
+ new ExpressRouteGatewayPropertiesAutoScaleConfiguration()
+ .withBounds(new ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds().withMin(3)))
+ .withVirtualHub(
+ new VirtualHubId()
+ .withId(
+ "/subscriptions/subid/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName")),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysDeleteSamples.java
new file mode 100644
index 0000000000000..5b2998f357c04
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways Delete. */
+public final class ExpressRouteGatewaysDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteGatewayDelete.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteGatewayDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteGateways()
+ .delete("resourceGroupName", "expressRouteGatewayName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..30208e557b071
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways GetByResourceGroup. */
+public final class ExpressRouteGatewaysGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteGatewayGet.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteGatewayGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteGateways()
+ .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..63947c2f0d01e
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysListByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways ListByResourceGroup. */
+public final class ExpressRouteGatewaysListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteGatewayListByResourceGroup.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteGatewayListByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteGateways()
+ .listByResourceGroupWithResponse("resourceGroupName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysListBySubscriptionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysListBySubscriptionSamples.java
new file mode 100644
index 0000000000000..c4d258a9366b9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysListBySubscriptionSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteGateways ListBySubscription. */
+public final class ExpressRouteGatewaysListBySubscriptionSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteGatewayListBySubscription.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayListBySubscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteGatewayListBySubscription(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteGateways()
+ .listBySubscriptionWithResponse(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysUpdateTagsSamples.java
new file mode 100644
index 0000000000000..0c3d502089792
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteGatewaysUpdateTagsSamples.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRouteGateways UpdateTags. */
+public final class ExpressRouteGatewaysUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteGatewayUpdateTags.json
+ */
+ /**
+ * Sample code: ExpressRouteGatewayUpdate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteGatewayUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteGateways()
+ .updateTags(
+ "resourceGroupName",
+ "expressRouteGatewayName",
+ new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteLinksGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteLinksGetSamples.java
new file mode 100644
index 0000000000000..feecd54a72fd1
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteLinksGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteLinks Get. */
+public final class ExpressRouteLinksGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteLinkGet.json
+ */
+ /**
+ * Sample code: ExpressRouteLinkGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteLinkGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRouteLinks()
+ .getWithResponse("rg1", "portName", "linkName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteLinksListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteLinksListSamples.java
new file mode 100644
index 0000000000000..0d4abf3b26e43
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteLinksListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteLinks List. */
+public final class ExpressRouteLinksListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteLinkList.json
+ */
+ /**
+ * Sample code: ExpressRouteLinkGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRouteLinkGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRouteLinks().list("rg1", "portName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..0e78844c787db
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsCreateOrUpdateSamples.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.ExpressRouteLinkInner;
+import com.azure.resourcemanager.network.fluent.models.ExpressRoutePortInner;
+import com.azure.resourcemanager.network.models.ExpressRouteLinkAdminState;
+import com.azure.resourcemanager.network.models.ExpressRoutePortsEncapsulation;
+import java.util.Arrays;
+
+/** Samples for ExpressRoutePorts CreateOrUpdate. */
+public final class ExpressRoutePortsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortUpdateLink.json
+ */
+ /**
+ * Sample code: ExpressRoutePortUpdateLink.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortUpdateLink(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRoutePorts()
+ .createOrUpdate(
+ "rg1",
+ "portName",
+ new ExpressRoutePortInner()
+ .withLocation("westus")
+ .withPeeringLocation("peeringLocationName")
+ .withBandwidthInGbps(100)
+ .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ)
+ .withLinks(
+ Arrays
+ .asList(
+ new ExpressRouteLinkInner()
+ .withName("link1")
+ .withAdminState(ExpressRouteLinkAdminState.ENABLED))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortCreate.json
+ */
+ /**
+ * Sample code: ExpressRoutePortCreate.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortCreate(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRoutePorts()
+ .createOrUpdate(
+ "rg1",
+ "portName",
+ new ExpressRoutePortInner()
+ .withLocation("westus")
+ .withPeeringLocation("peeringLocationName")
+ .withBandwidthInGbps(100)
+ .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsDeleteSamples.java
new file mode 100644
index 0000000000000..a774bea5e6664
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts Delete. */
+public final class ExpressRoutePortsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortDelete.json
+ */
+ /**
+ * Sample code: ExpressRoutePortDelete.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortDelete(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRoutePorts().delete("rg1", "portName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsGenerateLoaSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsGenerateLoaSamples.java
new file mode 100644
index 0000000000000..fc6c0a042970a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsGenerateLoaSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.GenerateExpressRoutePortsLoaRequest;
+
+/** Samples for ExpressRoutePorts GenerateLoa. */
+public final class ExpressRoutePortsGenerateLoaSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/GenerateExpressRoutePortsLOA.json
+ */
+ /**
+ * Sample code: GenerateExpressRoutePortLOA.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void generateExpressRoutePortLOA(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRoutePorts()
+ .generateLoaWithResponse(
+ "rg1",
+ "portName",
+ new GenerateExpressRoutePortsLoaRequest().withCustomerName("customerName"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..303cef9f76de8
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts GetByResourceGroup. */
+public final class ExpressRoutePortsGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortGet.json
+ */
+ /**
+ * Sample code: ExpressRoutePortGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRoutePorts()
+ .getByResourceGroupWithResponse("rg1", "portName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..fa046ea454686
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts ListByResourceGroup. */
+public final class ExpressRoutePortsListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortListByResourceGroup.json
+ */
+ /**
+ * Sample code: ExpressRoutePortListByResourceGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortListByResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRoutePorts().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsListSamples.java
new file mode 100644
index 0000000000000..e0841c3a1ad28
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePorts List. */
+public final class ExpressRoutePortsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortList.json
+ */
+ /**
+ * Sample code: ExpressRoutePortList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRoutePorts().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsLocationsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsLocationsGetSamples.java
new file mode 100644
index 0000000000000..f8ea92ec8bbdc
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsLocationsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortsLocations Get. */
+public final class ExpressRoutePortsLocationsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortsLocationGet.json
+ */
+ /**
+ * Sample code: ExpressRoutePortsLocationGet.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortsLocationGet(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRoutePortsLocations()
+ .getWithResponse("locationName", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsLocationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsLocationsListSamples.java
new file mode 100644
index 0000000000000..20986e2c93e1d
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsLocationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRoutePortsLocations List. */
+public final class ExpressRoutePortsLocationsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortsLocationList.json
+ */
+ /**
+ * Sample code: ExpressRoutePortsLocationList.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortsLocationList(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRoutePortsLocations().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..eb5a2e4f30d8a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRoutePortsUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for ExpressRoutePorts UpdateTags. */
+public final class ExpressRoutePortsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRoutePortUpdateTags.json
+ */
+ /**
+ * Sample code: ExpressRoutePortUpdateTags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void expressRoutePortUpdateTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getExpressRoutePorts()
+ .updateTagsWithResponse(
+ "rg1", "portName", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteServiceProvidersListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteServiceProvidersListSamples.java
new file mode 100644
index 0000000000000..62cfd79ded960
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/ExpressRouteServiceProvidersListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for ExpressRouteServiceProviders List. */
+public final class ExpressRouteServiceProvidersListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ExpressRouteProviderList.json
+ */
+ /**
+ * Sample code: List ExpressRoute providers.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listExpressRouteProviders(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getExpressRouteServiceProviders().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..b36c267a374a6
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesCreateOrUpdateSamples.java
@@ -0,0 +1,141 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.management.SubResource;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.FirewallPolicyInner;
+import com.azure.resourcemanager.network.models.AzureFirewallThreatIntelMode;
+import com.azure.resourcemanager.network.models.DnsSettings;
+import com.azure.resourcemanager.network.models.ExplicitProxySettings;
+import com.azure.resourcemanager.network.models.FirewallPolicyCertificateAuthority;
+import com.azure.resourcemanager.network.models.FirewallPolicyInsights;
+import com.azure.resourcemanager.network.models.FirewallPolicyIntrusionDetection;
+import com.azure.resourcemanager.network.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications;
+import com.azure.resourcemanager.network.models.FirewallPolicyIntrusionDetectionConfiguration;
+import com.azure.resourcemanager.network.models.FirewallPolicyIntrusionDetectionProtocol;
+import com.azure.resourcemanager.network.models.FirewallPolicyIntrusionDetectionSignatureSpecification;
+import com.azure.resourcemanager.network.models.FirewallPolicyIntrusionDetectionStateType;
+import com.azure.resourcemanager.network.models.FirewallPolicyLogAnalyticsResources;
+import com.azure.resourcemanager.network.models.FirewallPolicyLogAnalyticsWorkspace;
+import com.azure.resourcemanager.network.models.FirewallPolicySku;
+import com.azure.resourcemanager.network.models.FirewallPolicySkuTier;
+import com.azure.resourcemanager.network.models.FirewallPolicySnat;
+import com.azure.resourcemanager.network.models.FirewallPolicySql;
+import com.azure.resourcemanager.network.models.FirewallPolicyThreatIntelWhitelist;
+import com.azure.resourcemanager.network.models.FirewallPolicyTransportSecurity;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FirewallPolicies CreateOrUpdate. */
+public final class FirewallPoliciesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createFirewallPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicies()
+ .createOrUpdate(
+ "rg1",
+ "firewallPolicy",
+ new FirewallPolicyInner()
+ .withLocation("West US")
+ .withTags(mapOf("key1", "value1"))
+ .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT)
+ .withThreatIntelWhitelist(
+ new FirewallPolicyThreatIntelWhitelist()
+ .withIpAddresses(Arrays.asList("20.3.4.5"))
+ .withFqdns(Arrays.asList("*.microsoft.com")))
+ .withInsights(
+ new FirewallPolicyInsights()
+ .withIsEnabled(true)
+ .withRetentionDays(100)
+ .withLogAnalyticsResources(
+ new FirewallPolicyLogAnalyticsResources()
+ .withWorkspaces(
+ Arrays
+ .asList(
+ new FirewallPolicyLogAnalyticsWorkspace()
+ .withRegion("westus")
+ .withWorkspaceId(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1")),
+ new FirewallPolicyLogAnalyticsWorkspace()
+ .withRegion("eastus")
+ .withWorkspaceId(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2"))))
+ .withDefaultWorkspaceId(
+ new SubResource()
+ .withId(
+ "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace"))))
+ .withSnat(new FirewallPolicySnat().withPrivateRanges(Arrays.asList("IANAPrivateRanges")))
+ .withSql(new FirewallPolicySql().withAllowSqlRedirect(true))
+ .withDnsSettings(
+ new DnsSettings()
+ .withServers(Arrays.asList("30.3.4.5"))
+ .withEnableProxy(true)
+ .withRequireProxyForNetworkRules(false))
+ .withExplicitProxySettings(
+ new ExplicitProxySettings()
+ .withEnableExplicitProxy(true)
+ .withHttpPort(8087)
+ .withHttpsPort(8087)
+ .withPacFilePort(8087)
+ .withPacFile(
+ "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D"))
+ .withIntrusionDetection(
+ new FirewallPolicyIntrusionDetection()
+ .withMode(FirewallPolicyIntrusionDetectionStateType.ALERT)
+ .withConfiguration(
+ new FirewallPolicyIntrusionDetectionConfiguration()
+ .withSignatureOverrides(
+ Arrays
+ .asList(
+ new FirewallPolicyIntrusionDetectionSignatureSpecification()
+ .withId("2525004")
+ .withMode(FirewallPolicyIntrusionDetectionStateType.DENY)))
+ .withBypassTrafficSettings(
+ Arrays
+ .asList(
+ new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications()
+ .withName("bypassRule1")
+ .withDescription("Rule 1")
+ .withProtocol(FirewallPolicyIntrusionDetectionProtocol.TCP)
+ .withSourceAddresses(Arrays.asList("1.2.3.4"))
+ .withDestinationAddresses(Arrays.asList("5.6.7.8"))
+ .withDestinationPorts(Arrays.asList("*"))))))
+ .withTransportSecurity(
+ new FirewallPolicyTransportSecurity()
+ .withCertificateAuthority(
+ new FirewallPolicyCertificateAuthority()
+ .withKeyVaultSecretId("https://kv/secret")
+ .withName("clientcert")))
+ .withSku(new FirewallPolicySku().withTier(FirewallPolicySkuTier.PREMIUM)),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesDeleteSamples.java
new file mode 100644
index 0000000000000..3108dd411267a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies Delete. */
+public final class FirewallPoliciesDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyDelete.json
+ */
+ /**
+ * Sample code: Delete Firewall Policy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteFirewallPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getFirewallPolicies().delete("rg1", "firewallPolicy", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesGetByResourceGroupSamples.java
new file mode 100644
index 0000000000000..244172d9f3fca
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesGetByResourceGroupSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies GetByResourceGroup. */
+public final class FirewallPoliciesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getFirewallPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicies()
+ .getByResourceGroupWithResponse("rg1", "firewallPolicy", null, Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesListByResourceGroupSamples.java
new file mode 100644
index 0000000000000..7429c1353f47a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesListByResourceGroupSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies ListByResourceGroup. */
+public final class FirewallPoliciesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyListByResourceGroup.json
+ */
+ /**
+ * Sample code: List all Firewall Policies for a given resource group.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllFirewallPoliciesForAGivenResourceGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getFirewallPolicies().listByResourceGroup("rg1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesListSamples.java
new file mode 100644
index 0000000000000..2658eb02961df
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPoliciesListSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicies List. */
+public final class FirewallPoliciesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyListBySubscription.json
+ */
+ /**
+ * Sample code: List all Firewall Policies for a given subscription.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllFirewallPoliciesForAGivenSubscription(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getFirewallPolicies().list(Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java
new file mode 100644
index 0000000000000..6e90857f5fada
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.SignatureOverridesFilterValuesQuery;
+
+/** Samples for FirewallPolicyIdpsSignaturesFilterValues List. */
+public final class FirewallPolicyIdpsSignaturesFilterValuesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyQuerySignatureOverridesFilterValues.json
+ */
+ /**
+ * Sample code: query signature overrides.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void querySignatureOverrides(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyIdpsSignaturesFilterValues()
+ .listWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new SignatureOverridesFilterValuesQuery().withFilterName("severity"),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesListSamples.java
new file mode 100644
index 0000000000000..42ac76dec505a
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesListSamples.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.FilterItems;
+import com.azure.resourcemanager.network.models.IdpsQueryObject;
+import com.azure.resourcemanager.network.models.OrderBy;
+import com.azure.resourcemanager.network.models.OrderByOrder;
+import java.util.Arrays;
+
+/** Samples for FirewallPolicyIdpsSignatures List. */
+public final class FirewallPolicyIdpsSignaturesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyQuerySignatureOverrides.json
+ */
+ /**
+ * Sample code: query signature overrides.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void querySignatureOverrides(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyIdpsSignatures()
+ .listWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new IdpsQueryObject()
+ .withFilters(Arrays.asList(new FilterItems().withField("Mode").withValues(Arrays.asList("Deny"))))
+ .withSearch("")
+ .withOrderBy(new OrderBy().withField("severity").withOrder(OrderByOrder.ASCENDING))
+ .withResultsPerPage(20)
+ .withSkip(0),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java
new file mode 100644
index 0000000000000..c4364d7482bef
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides Get. */
+public final class FirewallPolicyIdpsSignaturesOverridesGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicySignatureOverridesGet.json
+ */
+ /**
+ * Sample code: get signature overrides.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getSignatureOverrides(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyIdpsSignaturesOverrides()
+ .getWithResponse("rg1", "firewallPolicy", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java
new file mode 100644
index 0000000000000..438dec122e453
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides List. */
+public final class FirewallPolicyIdpsSignaturesOverridesListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicySignatureOverridesList.json
+ */
+ /**
+ * Sample code: get signature overrides.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getSignatureOverrides(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyIdpsSignaturesOverrides()
+ .listWithResponse("rg1", "firewallPolicy", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.java
new file mode 100644
index 0000000000000..7b237ddf1da20
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.SignaturesOverridesInner;
+import com.azure.resourcemanager.network.models.SignaturesOverridesProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides Patch. */
+public final class FirewallPolicyIdpsSignaturesOverridesPatchSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicySignatureOverridesPatch.json
+ */
+ /**
+ * Sample code: patch signature overrides.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void patchSignatureOverrides(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyIdpsSignaturesOverrides()
+ .patchWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new SignaturesOverridesInner()
+ .withName("default")
+ .withId(
+ "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default")
+ .withType("Microsoft.Network/firewallPolicies/signatureOverrides")
+ .withProperties(
+ new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.java
new file mode 100644
index 0000000000000..5568c9177a503
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.SignaturesOverridesInner;
+import com.azure.resourcemanager.network.models.SignaturesOverridesProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FirewallPolicyIdpsSignaturesOverrides Put. */
+public final class FirewallPolicyIdpsSignaturesOverridesPutSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicySignatureOverridesPut.json
+ */
+ /**
+ * Sample code: put signature overrides.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void putSignatureOverrides(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyIdpsSignaturesOverrides()
+ .putWithResponse(
+ "rg1",
+ "firewallPolicy",
+ new SignaturesOverridesInner()
+ .withName("default")
+ .withId(
+ "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default")
+ .withType("Microsoft.Network/firewallPolicies/signatureOverrides")
+ .withProperties(
+ new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))),
+ Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..c4b820aa11599
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.java
@@ -0,0 +1,210 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.FirewallPolicyRuleCollectionGroupInner;
+import com.azure.resourcemanager.network.models.ApplicationRule;
+import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollection;
+import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionAction;
+import com.azure.resourcemanager.network.models.FirewallPolicyFilterRuleCollectionActionType;
+import com.azure.resourcemanager.network.models.FirewallPolicyNatRuleCollection;
+import com.azure.resourcemanager.network.models.FirewallPolicyNatRuleCollectionAction;
+import com.azure.resourcemanager.network.models.FirewallPolicyNatRuleCollectionActionType;
+import com.azure.resourcemanager.network.models.FirewallPolicyRuleApplicationProtocol;
+import com.azure.resourcemanager.network.models.FirewallPolicyRuleApplicationProtocolType;
+import com.azure.resourcemanager.network.models.FirewallPolicyRuleNetworkProtocol;
+import com.azure.resourcemanager.network.models.NatRule;
+import com.azure.resourcemanager.network.models.NetworkRule;
+import java.util.Arrays;
+
+/** Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate. */
+public final class FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyRuleCollectionGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .createOrUpdate(
+ "rg1",
+ "firewallPolicy",
+ "ruleCollectionGroup1",
+ new FirewallPolicyRuleCollectionGroupInner()
+ .withPriority(100)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyFilterRuleCollection()
+ .withName("Example-Filter-Rule-Collection")
+ .withPriority(100)
+ .withAction(
+ new FirewallPolicyFilterRuleCollectionAction()
+ .withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new NetworkRule()
+ .withName("network-rule1")
+ .withIpProtocols(
+ Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP))
+ .withSourceAddresses(Arrays.asList("10.1.25.0/24"))
+ .withDestinationAddresses(Arrays.asList("*"))
+ .withDestinationPorts(Arrays.asList("*")))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyRuleCollectionGroup With IpGroups.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createFirewallPolicyRuleCollectionGroupWithIpGroups(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .createOrUpdate(
+ "rg1",
+ "firewallPolicy",
+ "ruleCollectionGroup1",
+ new FirewallPolicyRuleCollectionGroupInner()
+ .withPriority(110)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyFilterRuleCollection()
+ .withName("Example-Filter-Rule-Collection")
+ .withAction(
+ new FirewallPolicyFilterRuleCollectionAction()
+ .withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new NetworkRule()
+ .withName("network-1")
+ .withIpProtocols(
+ Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP))
+ .withDestinationPorts(Arrays.asList("*"))
+ .withSourceIpGroups(
+ Arrays
+ .asList(
+ "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1"))
+ .withDestinationIpGroups(
+ Arrays
+ .asList(
+ "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyRuleCollectionGroup With Web Categories.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createFirewallPolicyRuleCollectionGroupWithWebCategories(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .createOrUpdate(
+ "rg1",
+ "firewallPolicy",
+ "ruleCollectionGroup1",
+ new FirewallPolicyRuleCollectionGroupInner()
+ .withPriority(110)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyFilterRuleCollection()
+ .withName("Example-Filter-Rule-Collection")
+ .withAction(
+ new FirewallPolicyFilterRuleCollectionAction()
+ .withType(FirewallPolicyFilterRuleCollectionActionType.DENY))
+ .withRules(
+ Arrays
+ .asList(
+ new ApplicationRule()
+ .withName("rule1")
+ .withDescription("Deny inbound rule")
+ .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24"))
+ .withProtocols(
+ Arrays
+ .asList(
+ new FirewallPolicyRuleApplicationProtocol()
+ .withProtocolType(
+ FirewallPolicyRuleApplicationProtocolType.HTTPS)
+ .withPort(443)))
+ .withWebCategories(Arrays.asList("Hacking")))))),
+ Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyNatRuleCollectionGroupPut.json
+ */
+ /**
+ * Sample code: Create FirewallPolicyNatRuleCollectionGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createFirewallPolicyNatRuleCollectionGroup(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .createOrUpdate(
+ "rg1",
+ "firewallPolicy",
+ "ruleCollectionGroup1",
+ new FirewallPolicyRuleCollectionGroupInner()
+ .withPriority(100)
+ .withRuleCollections(
+ Arrays
+ .asList(
+ new FirewallPolicyNatRuleCollection()
+ .withName("Example-Nat-Rule-Collection")
+ .withPriority(100)
+ .withAction(
+ new FirewallPolicyNatRuleCollectionAction()
+ .withType(FirewallPolicyNatRuleCollectionActionType.DNAT))
+ .withRules(
+ Arrays
+ .asList(
+ new NatRule()
+ .withName("nat-rule1")
+ .withIpProtocols(
+ Arrays
+ .asList(
+ FirewallPolicyRuleNetworkProtocol.TCP,
+ FirewallPolicyRuleNetworkProtocol.UDP))
+ .withSourceAddresses(Arrays.asList("2.2.2.2"))
+ .withDestinationAddresses(Arrays.asList("152.23.32.23"))
+ .withDestinationPorts(Arrays.asList("8080"))
+ .withTranslatedPort("8080")
+ .withSourceIpGroups(Arrays.asList())
+ .withTranslatedFqdn("internalhttp.server.net"))))),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java
new file mode 100644
index 0000000000000..9cad9a1d7f586
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyRuleCollectionGroups Delete. */
+public final class FirewallPolicyRuleCollectionGroupsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupDelete.json
+ */
+ /**
+ * Sample code: Delete FirewallPolicyRuleCollectionGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .delete("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java
new file mode 100644
index 0000000000000..5c7cdf1f03914
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyRuleCollectionGroups Get. */
+public final class FirewallPolicyRuleCollectionGroupsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyNatRuleCollectionGroupGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyNatRuleCollectionGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getFirewallPolicyNatRuleCollectionGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyRuleCollectionGroup With Web Categories.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getFirewallPolicyRuleCollectionGroupWithWebCategories(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyRuleCollectionGroup.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json
+ */
+ /**
+ * Sample code: Get FirewallPolicyRuleCollectionGroup With IpGroups.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getFirewallPolicyRuleCollectionGroupWithIpGroups(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .getWithResponse("rg1", "firewallPolicy", "ruleGroup1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsListSamples.java
new file mode 100644
index 0000000000000..5760b350d44bd
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FirewallPolicyRuleCollectionGroupsListSamples.java
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FirewallPolicyRuleCollectionGroups List. */
+public final class FirewallPolicyRuleCollectionGroupsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupList.json
+ */
+ /**
+ * Sample code: List all FirewallPolicyRuleCollectionGroups for a given FirewallPolicy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .list("rg1", "firewallPolicy", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupWithIpGroupsList.json
+ */
+ /**
+ * Sample code: List all FirewallPolicyRuleCollectionGroups with IpGroups for a given FirewallPolicy.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllFirewallPolicyRuleCollectionGroupsWithIpGroupsForAGivenFirewallPolicy(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .list("rg1", "firewallPolicy", Context.NONE);
+ }
+
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json
+ */
+ /**
+ * Sample code: List all FirewallPolicyRuleCollectionGroup With Web Categories.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listAllFirewallPolicyRuleCollectionGroupWithWebCategories(
+ com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFirewallPolicyRuleCollectionGroups()
+ .list("rg1", "firewallPolicy", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsCreateOrUpdateSamples.java
new file mode 100644
index 0000000000000..71d2a678e391b
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsCreateOrUpdateSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.fluent.models.FlowLogInner;
+import com.azure.resourcemanager.network.models.FlowLogFormatParameters;
+import com.azure.resourcemanager.network.models.FlowLogFormatType;
+
+/** Samples for FlowLogs CreateOrUpdate. */
+public final class FlowLogsCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherFlowLogCreate.json
+ */
+ /**
+ * Sample code: Create or update flow log.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void createOrUpdateFlowLog(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFlowLogs()
+ .createOrUpdate(
+ "rg1",
+ "nw1",
+ "fl",
+ new FlowLogInner()
+ .withLocation("centraluseuap")
+ .withTargetResourceId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg")
+ .withStorageId(
+ "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe")
+ .withEnabled(true)
+ .withFormat(new FlowLogFormatParameters().withType(FlowLogFormatType.JSON).withVersion(1)),
+ Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsDeleteSamples.java
new file mode 100644
index 0000000000000..bf8b59e16c0e9
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FlowLogs Delete. */
+public final class FlowLogsDeleteSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherFlowLogDelete.json
+ */
+ /**
+ * Sample code: Delete flow log.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void deleteFlowLog(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getFlowLogs().delete("rg1", "nw1", "fl", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsGetSamples.java
new file mode 100644
index 0000000000000..1b2229af1dce7
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsGetSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FlowLogs Get. */
+public final class FlowLogsGetSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherFlowLogGet.json
+ */
+ /**
+ * Sample code: Get flow log.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void getFlowLog(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFlowLogs()
+ .getWithResponse("rg1", "nw1", "flowLog1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsListSamples.java
new file mode 100644
index 0000000000000..760b7391d4697
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+
+/** Samples for FlowLogs List. */
+public final class FlowLogsListSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherFlowLogList.json
+ */
+ /**
+ * Sample code: List connection monitors.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void listConnectionMonitors(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure.networks().manager().serviceClient().getFlowLogs().list("rg1", "nw1", Context.NONE);
+ }
+}
diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsUpdateTagsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsUpdateTagsSamples.java
new file mode 100644
index 0000000000000..100caf03a15db
--- /dev/null
+++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/FlowLogsUpdateTagsSamples.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.network.generated;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.network.models.TagsObject;
+import java.util.HashMap;
+import java.util.Map;
+
+/** Samples for FlowLogs UpdateTags. */
+public final class FlowLogsUpdateTagsSamples {
+ /*
+ * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/NetworkWatcherFlowLogUpdateTags.json
+ */
+ /**
+ * Sample code: Update flow log tags.
+ *
+ * @param azure The entry point for accessing resource management APIs in Azure.
+ */
+ public static void updateFlowLogTags(com.azure.resourcemanager.AzureResourceManager azure) {
+ azure
+ .networks()
+ .manager()
+ .serviceClient()
+ .getFlowLogs()
+ .updateTagsWithResponse(
+ "rg1", "nw", "fl", new TagsObject().withTags(mapOf("tag1", "value1", "tag2", "value2")), Context.NONE);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map