From e941cc29f3c9cea388dda96201ebda61b0c3993d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 29 Apr 2022 11:04:19 +0000 Subject: [PATCH] CodeGen from PR 18851 in Azure/azure-rest-api-specs Merge 5b57da41275ceaae5d496cc63f7159fc7d36ba7a into ea9af04161c73743cdb40c1439a3046f16f35f71 --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 173 ++++- .../pom.xml | 2 +- .../azurestackhci/AzureStackHciManager.java | 26 +- .../fluent/ArcSettingsClient.java | 131 ++++ .../azurestackhci/fluent/ClustersClient.java | 156 +++- .../models/ArcIdentityResponseInner.java | 130 ++++ .../models/ArcIdentityResponseProperties.java | 124 ++++ .../fluent/models/ArcSettingInner.java | 115 +++ .../fluent/models/ArcSettingProperties.java | 130 ++++ .../models/ArcSettingsPatchProperties.java | 46 ++ .../models/ClusterIdentityResponseInner.java | 130 ++++ .../ClusterIdentityResponseProperties.java | 124 ++++ .../fluent/models/ClusterInner.java | 55 ++ .../fluent/models/ClusterProperties.java | 84 ++- .../models/PasswordCredentialInner.java | 125 ++++ .../ArcIdentityResponseImpl.java | 45 ++ .../implementation/ArcSettingImpl.java | 126 +++- .../implementation/ArcSettingsClientImpl.java | 674 ++++++++++++++++++ .../implementation/ArcSettingsImpl.java | 50 ++ .../AzureStackHciClientBuilder.java | 3 - .../AzureStackHciClientImpl.java | 2 +- .../ClusterIdentityResponseImpl.java | 45 ++ .../implementation/ClusterImpl.java | 40 ++ .../implementation/ClustersClientImpl.java | 669 ++++++++++++++++- .../implementation/ClustersImpl.java | 45 +- .../implementation/ExtensionsClientImpl.java | 2 +- .../PasswordCredentialImpl.java | 46 ++ .../azurestackhci/models/ActionType.java | 6 +- .../models/ArcIdentityResponse.java | 45 ++ .../azurestackhci/models/ArcSetting.java | 184 ++++- .../models/ArcSettingAggregateState.java | 6 +- .../azurestackhci/models/ArcSettings.java | 56 ++ .../models/ArcSettingsPatch.java | 91 +++ .../azurestackhci/models/Cluster.java | 84 +++ .../models/ClusterIdentityResponse.java | 45 ++ .../azurestackhci/models/Clusters.java | 61 +- .../azurestackhci/models/DiagnosticLevel.java | 6 +- .../models/ExtensionAggregateState.java | 6 +- .../azurestackhci/models/ImdsAttestation.java | 6 +- .../azurestackhci/models/NodeArcState.java | 6 +- .../models/NodeExtensionState.java | 6 +- .../azurestackhci/models/Origin.java | 6 +- .../models/PasswordCredential.java | 46 ++ .../models/ProvisioningState.java | 6 +- .../models/RawCertificateData.java | 47 ++ .../azurestackhci/models/Status.java | 6 +- .../models/UploadCertificateRequest.java | 49 ++ .../models/WindowsServerSubscription.java | 6 +- .../ArcSettingsCreateIdentitySamples.java | 22 + .../generated/ArcSettingsCreateSamples.java | 2 +- .../generated/ArcSettingsDeleteSamples.java | 2 +- .../ArcSettingsGeneratePasswordSamples.java | 22 + .../generated/ArcSettingsGetSamples.java | 2 +- .../ArcSettingsListByClusterSamples.java | 2 +- .../generated/ArcSettingsUpdateSamples.java | 35 + .../ClustersCreateIdentitySamples.java | 22 + .../generated/ClustersCreateSamples.java | 2 +- .../generated/ClustersDeleteSamples.java | 4 +- .../ClustersGetByResourceGroupSamples.java | 2 +- .../ClustersListByResourceGroupSamples.java | 2 +- .../generated/ClustersListSamples.java | 2 +- .../generated/ClustersUpdateSamples.java | 2 +- .../ClustersUploadCertificateSamples.java | 33 + .../generated/ExtensionsCreateSamples.java | 2 +- .../generated/ExtensionsDeleteSamples.java | 2 +- .../generated/ExtensionsGetSamples.java | 2 +- .../ExtensionsListByArcSettingSamples.java | 2 +- .../generated/ExtensionsUpdateSamples.java | 2 +- .../generated/OperationsListSamples.java | 7 +- 71 files changed, 4146 insertions(+), 107 deletions(-) create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java create mode 100644 sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md index 681c9bca3ed62..c8127a58f5833 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2022-04-29) + +- Azure Resource Manager AzureStackHci client library for Java. This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md index 6f4d73978e4be..49c5a0968a067 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureStackHci client library for Java. -This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureStackHci Management SDK. Azure Stack HCI management service. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-azurestackhci - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md index 4b71efad09f21..949f72862f798 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/SAMPLE.md @@ -4,18 +4,23 @@ ## ArcSettings - [Create](#arcsettings_create) +- [CreateIdentity](#arcsettings_createidentity) - [Delete](#arcsettings_delete) +- [GeneratePassword](#arcsettings_generatepassword) - [Get](#arcsettings_get) - [ListByCluster](#arcsettings_listbycluster) +- [Update](#arcsettings_update) ## Clusters - [Create](#clusters_create) +- [CreateIdentity](#clusters_createidentity) - [Delete](#clusters_delete) - [GetByResourceGroup](#clusters_getbyresourcegroup) - [List](#clusters_list) - [ListByResourceGroup](#clusters_listbyresourcegroup) - [Update](#clusters_update) +- [UploadCertificate](#clusters_uploadcertificate) ## Extensions @@ -34,7 +39,7 @@ /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. @@ -47,6 +52,27 @@ public final class ArcSettingsCreateSamples { } ``` +### ArcSettings_CreateIdentity + +```java +import com.azure.core.util.Context; + +/** Samples for ArcSettings CreateIdentity. */ +public final class ArcSettingsCreateIdentitySamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + */ + /** + * Sample code: Create Arc Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + ### ArcSettings_Delete ```java @@ -55,7 +81,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings Delete. */ public final class ArcSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. @@ -68,6 +94,27 @@ public final class ArcSettingsDeleteSamples { } ``` +### ArcSettings_GeneratePassword + +```java +import com.azure.core.util.Context; + +/** Samples for ArcSettings GeneratePassword. */ +public final class ArcSettingsGeneratePasswordSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + */ + /** + * Sample code: Generate Password. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().generatePasswordWithResponse("test-rg", "myCluster", "default", Context.NONE); + } +} +``` + ### ArcSettings_Get ```java @@ -76,7 +123,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings Get. */ public final class ArcSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. @@ -97,7 +144,7 @@ import com.azure.core.util.Context; /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. @@ -111,13 +158,47 @@ public final class ArcSettingsListByClusterSamples { } ``` +### ArcSettings_Update + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azurestackhci.models.ArcSetting; +import java.io.IOException; + +/** Samples for ArcSettings Update. */ +public final class ArcSettingsUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + */ + /** + * Sample code: Patch ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + ArcSetting resource = + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE).getValue(); + resource + .update() + .withConnectivityProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"enabled\":true}", Object.class, SerializerEncoding.JSON)) + .apply(); + } +} +``` + ### Clusters_Create ```java /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. @@ -138,6 +219,27 @@ public final class ClustersCreateSamples { } ``` +### Clusters_CreateIdentity + +```java +import com.azure.core.util.Context; + +/** Samples for Clusters CreateIdentity. */ +public final class ClustersCreateIdentitySamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + } +} +``` + ### Clusters_Delete ```java @@ -146,7 +248,7 @@ import com.azure.core.util.Context; /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. @@ -154,7 +256,7 @@ public final class ClustersDeleteSamples { * @param manager Entry point to AzureStackHciManager. */ public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().deleteWithResponse("test-rg", "myCluster", Context.NONE); + manager.clusters().delete("test-rg", "myCluster", Context.NONE); } } ``` @@ -167,7 +269,7 @@ import com.azure.core.util.Context; /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json */ /** * Sample code: Get cluster. @@ -188,7 +290,7 @@ import com.azure.core.util.Context; /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. @@ -210,7 +312,7 @@ import com.azure.core.util.Context; /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. @@ -238,7 +340,7 @@ import java.util.Map; /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. @@ -272,6 +374,38 @@ public final class ClustersUpdateSamples { } ``` +### Clusters_UploadCertificate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.util.Arrays; + +/** Samples for Clusters UploadCertificate. */ +public final class ClustersUploadCertificateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + */ + /** + * Sample code: Upload certificate. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .uploadCertificate( + "test-rg", + "myCluster", + new UploadCertificateRequest() + .withProperties( + new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), + Context.NONE); + } +} +``` + ### Extensions_Create ```java @@ -282,7 +416,7 @@ import java.io.IOException; /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. @@ -319,7 +453,7 @@ import com.azure.core.util.Context; /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. @@ -340,7 +474,7 @@ import com.azure.core.util.Context; /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. @@ -363,7 +497,7 @@ import com.azure.core.util.Context; /** Samples for Extensions ListByArcSetting. */ public final class ExtensionsListByArcSettingSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. @@ -389,7 +523,7 @@ import java.io.IOException; /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. @@ -425,15 +559,14 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json */ /** - * Sample code: List operations available with the Microsoft.AzureStackHCI provider. + * Sample code: Create cluster. * * @param manager Entry point to AzureStackHciManager. */ - public static void listOperationsAvailableWithTheMicrosoftAzureStackHCIProvider( - com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager.operations().listWithResponse(Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index e2dcabfb1e496..a2df841f41d72 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for AzureStackHci Management - This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-01. + This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2022-05. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java index 14bd3ff22b8a5..76182e85f4c09 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/AzureStackHciManager.java @@ -215,7 +215,7 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.azurestackhci") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -272,7 +272,11 @@ public AzureStackHciManager authenticate(TokenCredential credential, AzureProfil } } - /** @return Resource collection API of ArcSettings. */ + /** + * Gets the resource collection API of ArcSettings. + * + * @return Resource collection API of ArcSettings. + */ public ArcSettings arcSettings() { if (this.arcSettings == null) { this.arcSettings = new ArcSettingsImpl(clientObject.getArcSettings(), this); @@ -280,7 +284,11 @@ public ArcSettings arcSettings() { return arcSettings; } - /** @return Resource collection API of Clusters. */ + /** + * Gets the resource collection API of Clusters. + * + * @return Resource collection API of Clusters. + */ public Clusters clusters() { if (this.clusters == null) { this.clusters = new ClustersImpl(clientObject.getClusters(), this); @@ -288,7 +296,11 @@ public Clusters clusters() { return clusters; } - /** @return Resource collection API of Extensions. */ + /** + * Gets the resource collection API of Extensions. + * + * @return Resource collection API of Extensions. + */ public Extensions extensions() { if (this.extensions == null) { this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); @@ -296,7 +308,11 @@ public Extensions extensions() { return extensions; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java index 054a33bb28724..e7dd0a66b8486 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ArcSettingsClient.java @@ -11,7 +11,10 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; /** An instance of this class provides access to all the operations defined in ArcSettingsClient. */ public interface ArcSettingsClient { @@ -109,6 +112,43 @@ Response createWithResponse( ArcSettingInner arcSetting, Context context); + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting); + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingsPatch arcSetting, + Context context); + /** * Delete ArcSetting resource details of HCI Cluster. * @@ -165,4 +205,95 @@ SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PasswordCredentialInner generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ArcIdentityResponseInner createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java index c68684543ff8f..625ccd127e93b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/ClustersClient.java @@ -8,9 +8,13 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; /** An instance of this class provides access to all the operations defined in ClustersClient. */ public interface ClustersClient { @@ -149,6 +153,33 @@ Response createWithResponse( Response updateWithResponse( String resourceGroupName, String clusterName, ClusterPatch cluster, Context context); + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + /** * Delete an HCI cluster. * @@ -170,8 +201,129 @@ Response updateWithResponse( * @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. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java new file mode 100644 index 0000000000000..909acd05b51ed --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ArcIdentity details. */ +@Immutable +public final class ArcIdentityResponseInner { + /* + * ArcIdentity properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ArcIdentityResponseProperties innerProperties; + + /** + * Get the innerProperties property: ArcIdentity properties. + * + * @return the innerProperties value. + */ + private ArcIdentityResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); + } + + /** + * Set the arcApplicationClientId property: The arcApplicationClientId property. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationClientId(String arcApplicationClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + /** + * Get the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); + } + + /** + * Set the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationTenantId(String arcApplicationTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); + } + + /** + * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + /** + * Get the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); + } + + /** + * Set the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcIdentityResponseInner object itself. + */ + public ArcIdentityResponseInner withArcApplicationObjectId(String arcApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcIdentityResponseProperties(); + } + this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java new file mode 100644 index 0000000000000..5b20f4848fb72 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcIdentityResponseProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ArcIdentityResponseProperties model. */ +@Fluent +public final class ArcIdentityResponseProperties { + /* + * The arcApplicationClientId property. + */ + @JsonProperty(value = "arcApplicationClientId") + private String arcApplicationClientId; + + /* + * The arcApplicationTenantId property. + */ + @JsonProperty(value = "arcApplicationTenantId") + private String arcApplicationTenantId; + + /* + * The arcServicePrincipalObjectId property. + */ + @JsonProperty(value = "arcServicePrincipalObjectId") + private String arcServicePrincipalObjectId; + + /* + * The arcApplicationObjectId property. + */ + @JsonProperty(value = "arcApplicationObjectId") + private String arcApplicationObjectId; + + /** + * Get the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.arcApplicationClientId; + } + + /** + * Set the arcApplicationClientId property: The arcApplicationClientId property. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationClientId(String arcApplicationClientId) { + this.arcApplicationClientId = arcApplicationClientId; + return this; + } + + /** + * Get the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.arcApplicationTenantId; + } + + /** + * Set the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationTenantId(String arcApplicationTenantId) { + this.arcApplicationTenantId = arcApplicationTenantId; + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.arcServicePrincipalObjectId; + } + + /** + * Set the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; + return this; + } + + /** + * Get the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.arcApplicationObjectId; + } + + /** + * Set the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcIdentityResponseProperties object itself. + */ + public ArcIdentityResponseProperties withArcApplicationObjectId(String arcApplicationObjectId) { + this.arcApplicationObjectId = arcApplicationObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java index 8af2c532e7167..cfdbb16c5d221 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingInner.java @@ -80,6 +80,98 @@ public ArcSettingInner withArcInstanceResourceGroup(String arcInstanceResourceGr return this; } + /** + * Get the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationClientId(); + } + + /** + * Set the arcApplicationClientId property: App id of arc AAD identity. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationClientId(String arcApplicationClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + /** + * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationTenantId(); + } + + /** + * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationTenantId(String arcApplicationTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcServicePrincipalObjectId(); + } + + /** + * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + /** + * Get the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().arcApplicationObjectId(); + } + + /** + * Set the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withArcApplicationObjectId(String arcApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + /** * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. * @@ -98,6 +190,29 @@ public List perNodeDetails() { return this.innerProperties() == null ? null : this.innerProperties().perNodeDetails(); } + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityProperties(); + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingInner object itself. + */ + public ArcSettingInner withConnectivityProperties(Object connectivityProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingProperties(); + } + this.innerProperties().withConnectivityProperties(connectivityProperties); + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java index 45e5201c7b58f..e628ec8d6f034 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingProperties.java @@ -27,6 +27,30 @@ public final class ArcSettingProperties { @JsonProperty(value = "arcInstanceResourceGroup") private String arcInstanceResourceGroup; + /* + * App id of arc AAD identity. + */ + @JsonProperty(value = "arcApplicationClientId") + private String arcApplicationClientId; + + /* + * Tenant id of arc AAD identity. + */ + @JsonProperty(value = "arcApplicationTenantId") + private String arcApplicationTenantId; + + /* + * Object id of arc AAD service principal. + */ + @JsonProperty(value = "arcServicePrincipalObjectId") + private String arcServicePrincipalObjectId; + + /* + * Object id of arc AAD identity. + */ + @JsonProperty(value = "arcApplicationObjectId") + private String arcApplicationObjectId; + /* * Aggregate state of Arc agent across the nodes in this HCI cluster. */ @@ -39,6 +63,12 @@ public final class ArcSettingProperties { @JsonProperty(value = "perNodeDetails", access = JsonProperty.Access.WRITE_ONLY) private List perNodeDetails; + /* + * contains connectivity related configuration for ARC resources + */ + @JsonProperty(value = "connectivityProperties") + private Object connectivityProperties; + /** * Get the provisioningState property: Provisioning state of the ArcSetting proxy resource. * @@ -70,6 +100,86 @@ public ArcSettingProperties withArcInstanceResourceGroup(String arcInstanceResou return this; } + /** + * Get the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + public String arcApplicationClientId() { + return this.arcApplicationClientId; + } + + /** + * Set the arcApplicationClientId property: App id of arc AAD identity. + * + * @param arcApplicationClientId the arcApplicationClientId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationClientId(String arcApplicationClientId) { + this.arcApplicationClientId = arcApplicationClientId; + return this; + } + + /** + * Get the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + public String arcApplicationTenantId() { + return this.arcApplicationTenantId; + } + + /** + * Set the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @param arcApplicationTenantId the arcApplicationTenantId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationTenantId(String arcApplicationTenantId) { + this.arcApplicationTenantId = arcApplicationTenantId; + return this; + } + + /** + * Get the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + public String arcServicePrincipalObjectId() { + return this.arcServicePrincipalObjectId; + } + + /** + * Set the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @param arcServicePrincipalObjectId the arcServicePrincipalObjectId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.arcServicePrincipalObjectId = arcServicePrincipalObjectId; + return this; + } + + /** + * Get the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + public String arcApplicationObjectId() { + return this.arcApplicationObjectId; + } + + /** + * Set the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @param arcApplicationObjectId the arcApplicationObjectId value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withArcApplicationObjectId(String arcApplicationObjectId) { + this.arcApplicationObjectId = arcApplicationObjectId; + return this; + } + /** * Get the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. * @@ -88,6 +198,26 @@ public List perNodeDetails() { return this.perNodeDetails; } + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.connectivityProperties; + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingProperties object itself. + */ + public ArcSettingProperties withConnectivityProperties(Object connectivityProperties) { + this.connectivityProperties = connectivityProperties; + return this; + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.java new file mode 100644 index 0000000000000..ea82478352316 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ArcSettingsPatchProperties.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.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ArcSettings properties. */ +@Fluent +public final class ArcSettingsPatchProperties { + /* + * contains connectivity related configuration for ARC resources + */ + @JsonProperty(value = "connectivityProperties") + private Object connectivityProperties; + + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.connectivityProperties; + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingsPatchProperties object itself. + */ + public ArcSettingsPatchProperties withConnectivityProperties(Object connectivityProperties) { + this.connectivityProperties = connectivityProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java new file mode 100644 index 0000000000000..be934a9d5d353 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster Identity details. */ +@Immutable +public final class ClusterIdentityResponseInner { + /* + * Cluster identity properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private ClusterIdentityResponseProperties innerProperties; + + /** + * Get the innerProperties property: Cluster identity properties. + * + * @return the innerProperties value. + */ + private ClusterIdentityResponseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.innerProperties() == null ? null : this.innerProperties().aadClientId(); + } + + /** + * Set the aadClientId property: The aadClientId property. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadClientId(String aadClientId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadClientId(aadClientId); + return this; + } + + /** + * Get the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().aadTenantId(); + } + + /** + * Set the aadTenantId property: The aadTenantId property. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadTenantId(String aadTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadTenantId(aadTenantId); + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); + } + + /** + * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + + /** + * Get the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); + } + + /** + * Set the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterIdentityResponseInner object itself. + */ + public ClusterIdentityResponseInner withAadApplicationObjectId(String aadApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterIdentityResponseProperties(); + } + this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java new file mode 100644 index 0000000000000..745b333748ae2 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterIdentityResponseProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClusterIdentityResponseProperties model. */ +@Fluent +public final class ClusterIdentityResponseProperties { + /* + * The aadClientId property. + */ + @JsonProperty(value = "aadClientId") + private String aadClientId; + + /* + * The aadTenantId property. + */ + @JsonProperty(value = "aadTenantId") + private String aadTenantId; + + /* + * The aadServicePrincipalObjectId property. + */ + @JsonProperty(value = "aadServicePrincipalObjectId") + private String aadServicePrincipalObjectId; + + /* + * The aadApplicationObjectId property. + */ + @JsonProperty(value = "aadApplicationObjectId") + private String aadApplicationObjectId; + + /** + * Get the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + public String aadClientId() { + return this.aadClientId; + } + + /** + * Set the aadClientId property: The aadClientId property. + * + * @param aadClientId the aadClientId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadClientId(String aadClientId) { + this.aadClientId = aadClientId; + return this; + } + + /** + * Get the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set the aadTenantId property: The aadTenantId property. + * + * @param aadTenantId the aadTenantId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.aadServicePrincipalObjectId; + } + + /** + * Set the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; + return this; + } + + /** + * Get the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.aadApplicationObjectId; + } + + /** + * Set the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterIdentityResponseProperties object itself. + */ + public ClusterIdentityResponseProperties withAadApplicationObjectId(String aadApplicationObjectId) { + this.aadApplicationObjectId = aadApplicationObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java index 366e69ed4c3cc..90830dc5dd720 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterInner.java @@ -158,6 +158,52 @@ public ClusterInner withAadTenantId(String aadTenantId) { return this; } + /** + * Get the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadApplicationObjectId(); + } + + /** + * Set the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAadApplicationObjectId(String aadApplicationObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.innerProperties() == null ? null : this.innerProperties().aadServicePrincipalObjectId(); + } + + /** + * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + /** * Get the desiredProperties property: Desired properties of the cluster. * @@ -235,6 +281,15 @@ public OffsetDateTime lastBillingTimestamp() { return this.innerProperties() == null ? null : this.innerProperties().lastBillingTimestamp(); } + /** + * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().serviceEndpoint(); + } + /** * Validates the instance. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java index e3879a66753a0..cb7310c87094d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/ClusterProperties.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.azurestackhci.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; @@ -43,15 +42,27 @@ public final class ClusterProperties { /* * App id of cluster AAD identity. */ - @JsonProperty(value = "aadClientId", required = true) + @JsonProperty(value = "aadClientId") private String aadClientId; /* * Tenant id of cluster AAD identity. */ - @JsonProperty(value = "aadTenantId", required = true) + @JsonProperty(value = "aadTenantId") private String aadTenantId; + /* + * Object id of cluster AAD identity. + */ + @JsonProperty(value = "aadApplicationObjectId") + private String aadApplicationObjectId; + + /* + * Id of cluster identity service principal. + */ + @JsonProperty(value = "aadServicePrincipalObjectId") + private String aadServicePrincipalObjectId; + /* * Desired properties of the cluster. */ @@ -94,6 +105,12 @@ public final class ClusterProperties { @JsonProperty(value = "lastBillingTimestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastBillingTimestamp; + /* + * Region specific DataPath Endpoint of the cluster. + */ + @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String serviceEndpoint; + /** * Get the provisioningState property: Provisioning state. * @@ -181,6 +198,46 @@ public ClusterProperties withAadTenantId(String aadTenantId) { return this; } + /** + * Get the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + public String aadApplicationObjectId() { + return this.aadApplicationObjectId; + } + + /** + * Set the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @param aadApplicationObjectId the aadApplicationObjectId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadApplicationObjectId(String aadApplicationObjectId) { + this.aadApplicationObjectId = aadApplicationObjectId; + return this; + } + + /** + * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + public String aadServicePrincipalObjectId() { + return this.aadServicePrincipalObjectId; + } + + /** + * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.aadServicePrincipalObjectId = aadServicePrincipalObjectId; + return this; + } + /** * Get the desiredProperties property: Desired properties of the cluster. * @@ -255,22 +312,21 @@ public OffsetDateTime lastBillingTimestamp() { return this.lastBillingTimestamp; } + /** + * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + public String serviceEndpoint() { + return this.serviceEndpoint; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (aadClientId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property aadClientId in model ClusterProperties")); - } - if (aadTenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property aadTenantId in model ClusterProperties")); - } if (desiredProperties() != null) { desiredProperties().validate(); } @@ -278,6 +334,4 @@ public void validate() { reportedProperties().validate(); } } - - private static final ClientLogger LOGGER = new ClientLogger(ClusterProperties.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java new file mode 100644 index 0000000000000..92abc341b7391 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/fluent/models/PasswordCredentialInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PasswordCredential model. */ +@Fluent +public final class PasswordCredentialInner { + /* + * The secretText property. + */ + @JsonProperty(value = "secretText") + private String secretText; + + /* + * The keyId property. + */ + @JsonProperty(value = "keyId") + private String keyId; + + /* + * The startDateTime property. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The endDateTime property. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /** + * Get the secretText property: The secretText property. + * + * @return the secretText value. + */ + public String secretText() { + return this.secretText; + } + + /** + * Set the secretText property: The secretText property. + * + * @param secretText the secretText value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withSecretText(String secretText) { + this.secretText = secretText; + return this; + } + + /** + * Get the keyId property: The keyId property. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: The keyId property. + * + * @param keyId the keyId value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the startDateTime property: The startDateTime property. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The startDateTime property. + * + * @param startDateTime the startDateTime value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The endDateTime property. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The endDateTime property. + * + * @param endDateTime the endDateTime value to set. + * @return the PasswordCredentialInner object itself. + */ + public PasswordCredentialInner withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.java new file mode 100644 index 0000000000000..d0fa03aff9ea7 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcIdentityResponseImpl.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.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; + +public final class ArcIdentityResponseImpl implements ArcIdentityResponse { + private ArcIdentityResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ArcIdentityResponseImpl( + ArcIdentityResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String arcApplicationClientId() { + return this.innerModel().arcApplicationClientId(); + } + + public String arcApplicationTenantId() { + return this.innerModel().arcApplicationTenantId(); + } + + public String arcServicePrincipalObjectId() { + return this.innerModel().arcServicePrincipalObjectId(); + } + + public String arcApplicationObjectId() { + return this.innerModel().arcApplicationObjectId(); + } + + public ArcIdentityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java index e82064bbad739..223e2fa716d22 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingImpl.java @@ -4,27 +4,26 @@ package com.azure.resourcemanager.azurestackhci.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.ArcSetting; import com.azure.resourcemanager.azurestackhci.models.ArcSettingAggregateState; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; import com.azure.resourcemanager.azurestackhci.models.PerNodeState; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import java.util.Collections; import java.util.List; +import java.util.Map; -public final class ArcSettingImpl implements ArcSetting, ArcSetting.Definition { +public final class ArcSettingImpl implements ArcSetting, ArcSetting.Definition, ArcSetting.Update { private ArcSettingInner innerObject; private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; - ArcSettingImpl( - ArcSettingInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - public String id() { return this.innerModel().id(); } @@ -49,6 +48,22 @@ public String arcInstanceResourceGroup() { return this.innerModel().arcInstanceResourceGroup(); } + public String arcApplicationClientId() { + return this.innerModel().arcApplicationClientId(); + } + + public String arcApplicationTenantId() { + return this.innerModel().arcApplicationTenantId(); + } + + public String arcServicePrincipalObjectId() { + return this.innerModel().arcServicePrincipalObjectId(); + } + + public String arcApplicationObjectId() { + return this.innerModel().arcApplicationObjectId(); + } + public ArcSettingAggregateState aggregateState() { return this.innerModel().aggregateState(); } @@ -62,6 +77,10 @@ public List perNodeDetails() { } } + public Object connectivityProperties() { + return this.innerModel().connectivityProperties(); + } + public ArcSettingInner innerModel() { return this.innerObject; } @@ -76,6 +95,8 @@ private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { private String arcSettingName; + private ArcSettingsPatch updateArcSetting; + public ArcSettingImpl withExistingCluster(String resourceGroupName, String clusterName) { this.resourceGroupName = resourceGroupName; this.clusterName = clusterName; @@ -108,6 +129,40 @@ public ArcSetting create(Context context) { this.arcSettingName = name; } + public ArcSettingImpl update() { + this.updateArcSetting = new ArcSettingsPatch(); + return this; + } + + public ArcSetting apply() { + this.innerObject = + serviceManager + .serviceClient() + .getArcSettings() + .updateWithResponse(resourceGroupName, clusterName, arcSettingName, updateArcSetting, Context.NONE) + .getValue(); + return this; + } + + public ArcSetting apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getArcSettings() + .updateWithResponse(resourceGroupName, clusterName, arcSettingName, updateArcSetting, context) + .getValue(); + return this; + } + + ArcSettingImpl( + ArcSettingInner innerObject, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.arcSettingName = Utils.getValueFromIdByName(innerObject.id(), "arcSettings"); + } + public ArcSetting refresh() { this.innerObject = serviceManager @@ -128,8 +183,65 @@ public ArcSetting refresh(Context context) { return this; } + public PasswordCredential generatePassword() { + return serviceManager.arcSettings().generatePassword(resourceGroupName, clusterName, arcSettingName); + } + + public Response generatePasswordWithResponse(Context context) { + return serviceManager + .arcSettings() + .generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); + } + + public ArcIdentityResponse createIdentity() { + return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName); + } + + public ArcIdentityResponse createIdentity(Context context) { + return serviceManager.arcSettings().createIdentity(resourceGroupName, clusterName, arcSettingName, context); + } + public ArcSettingImpl withArcInstanceResourceGroup(String arcInstanceResourceGroup) { this.innerModel().withArcInstanceResourceGroup(arcInstanceResourceGroup); return this; } + + public ArcSettingImpl withArcApplicationClientId(String arcApplicationClientId) { + this.innerModel().withArcApplicationClientId(arcApplicationClientId); + return this; + } + + public ArcSettingImpl withArcApplicationTenantId(String arcApplicationTenantId) { + this.innerModel().withArcApplicationTenantId(arcApplicationTenantId); + return this; + } + + public ArcSettingImpl withArcServicePrincipalObjectId(String arcServicePrincipalObjectId) { + this.innerModel().withArcServicePrincipalObjectId(arcServicePrincipalObjectId); + return this; + } + + public ArcSettingImpl withArcApplicationObjectId(String arcApplicationObjectId) { + this.innerModel().withArcApplicationObjectId(arcApplicationObjectId); + return this; + } + + public ArcSettingImpl withConnectivityProperties(Object connectivityProperties) { + if (isInCreateMode()) { + this.innerModel().withConnectivityProperties(connectivityProperties); + return this; + } else { + this.updateArcSetting.withConnectivityProperties(connectivityProperties); + return this; + } + } + + public ArcSettingImpl withTags(Map tags) { + this.updateArcSetting.withTags(tags); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java index e20bce03155d2..bb8b31517e08f 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsClientImpl.java @@ -12,7 +12,9 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -32,8 +34,11 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; import com.azure.resourcemanager.azurestackhci.models.ArcSettingList; +import com.azure.resourcemanager.azurestackhci.models.ArcSettingsPatch; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -112,6 +117,23 @@ Mono> create( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ArcSettingsPatch arcSetting, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" @@ -128,6 +150,38 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generatePassword( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createIdentity( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("arcSettingName") String arcSettingName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -673,6 +727,195 @@ public Response createWithResponse( return createWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); } + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + arcSetting, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingsPatch arcSetting, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + if (arcSetting == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSetting is required and cannot be null.")); + } else { + arcSetting.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + arcSetting, + accept, + context); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @return arcSetting details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @return arcSetting details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcSettingInner update( + String resourceGroupName, String clusterName, String arcSettingName, ArcSettingsPatch arcSetting) { + return updateAsync(resourceGroupName, clusterName, arcSettingName, arcSetting).block(); + } + + /** + * Update ArcSettings for HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @param arcSetting ArcSettings parameters that needs to be updated. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcSetting details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String clusterName, + String arcSettingName, + ArcSettingsPatch arcSetting, + Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, arcSettingName, arcSetting, context).block(); + } + /** * Delete ArcSetting resource details of HCI Cluster. * @@ -925,6 +1168,437 @@ public void delete(String resourceGroupName, String clusterName, String arcSetti deleteAsync(resourceGroupName, clusterName, arcSettingName, context).block(); } + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generatePasswordWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generatePassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generatePasswordWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generatePassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generatePasswordAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PasswordCredentialInner generatePassword( + String resourceGroupName, String clusterName, String arcSettingName) { + return generatePasswordAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return generatePasswordWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (arcSettingName == null) { + return Mono.error(new IllegalArgumentException("Parameter arcSettingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + arcSettingName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the {@link PollerFlux} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArcIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + Mono>> mono = + createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArcIdentityResponseInner.class, + ArcIdentityResponseInner.class, + this.client.getContext()); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ArcIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createIdentityWithResponseAsync(resourceGroupName, clusterName, arcSettingName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ArcIdentityResponseInner.class, + ArcIdentityResponseInner.class, + context); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName).getSyncPoller(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ArcIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).getSyncPoller(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return arcIdentity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, arcSettingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcIdentityResponseInner createIdentity( + String resourceGroupName, String clusterName, String arcSettingName) { + return createIdentityAsync(resourceGroupName, clusterName, arcSettingName).block(); + } + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ArcIdentityResponseInner createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + return createIdentityAsync(resourceGroupName, clusterName, arcSettingName, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java index 552592e3f23f3..e7fc8d055b322 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ArcSettingsImpl.java @@ -10,9 +10,13 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.ArcSettingsClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.ArcIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.ArcSetting; import com.azure.resourcemanager.azurestackhci.models.ArcSettings; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; public final class ArcSettingsImpl implements ArcSettings { private static final ClientLogger LOGGER = new ClientLogger(ArcSettingsImpl.class); @@ -70,6 +74,52 @@ public void delete(String resourceGroupName, String clusterName, String arcSetti this.serviceClient().delete(resourceGroupName, clusterName, arcSettingName, context); } + public PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName) { + PasswordCredentialInner inner = + this.serviceClient().generatePassword(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new PasswordCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + Response inner = + this.serviceClient().generatePasswordWithResponse(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PasswordCredentialImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName) { + ArcIdentityResponseInner inner = + this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName); + if (inner != null) { + return new ArcIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ArcIdentityResponse createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context) { + ArcIdentityResponseInner inner = + this.serviceClient().createIdentity(resourceGroupName, clusterName, arcSettingName, context); + if (inner != null) { + return new ArcIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public ArcSetting getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java index deb531de19bc9..31e4c5141f028 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientBuilder.java @@ -119,9 +119,6 @@ public AzureStackHciClientBuilder serializerAdapter(SerializerAdapter serializer * @return an instance of AzureStackHciClientImpl. */ public AzureStackHciClientImpl buildClient() { - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } if (endpoint == null) { this.endpoint = "https://management.azure.com"; } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java index f2a2de92f00ec..431ed23d9af62 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/AzureStackHciClientImpl.java @@ -181,7 +181,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-01-01"; + this.apiVersion = "2022-05-01"; this.arcSettings = new ArcSettingsClientImpl(this); this.clusters = new ClustersClientImpl(this); this.extensions = new ExtensionsClientImpl(this); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.java new file mode 100644 index 0000000000000..bc4eb9adf8bee --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterIdentityResponseImpl.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.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; + +public final class ClusterIdentityResponseImpl implements ClusterIdentityResponse { + private ClusterIdentityResponseInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + ClusterIdentityResponseImpl( + ClusterIdentityResponseInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String aadClientId() { + return this.innerModel().aadClientId(); + } + + public String aadTenantId() { + return this.innerModel().aadTenantId(); + } + + public String aadServicePrincipalObjectId() { + return this.innerModel().aadServicePrincipalObjectId(); + } + + public String aadApplicationObjectId() { + return this.innerModel().aadApplicationObjectId(); + } + + public ClusterIdentityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java index b3ec5487314ff..a40ba16f582c8 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClusterImpl.java @@ -10,10 +10,12 @@ import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.Cluster; import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties; import com.azure.resourcemanager.azurestackhci.models.ProvisioningState; import com.azure.resourcemanager.azurestackhci.models.Status; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -76,6 +78,14 @@ public String aadTenantId() { return this.innerModel().aadTenantId(); } + public String aadApplicationObjectId() { + return this.innerModel().aadApplicationObjectId(); + } + + public String aadServicePrincipalObjectId() { + return this.innerModel().aadServicePrincipalObjectId(); + } + public ClusterDesiredProperties desiredProperties() { return this.innerModel().desiredProperties(); } @@ -104,6 +114,10 @@ public OffsetDateTime lastBillingTimestamp() { return this.innerModel().lastBillingTimestamp(); } + public String serviceEndpoint() { + return this.innerModel().serviceEndpoint(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -209,6 +223,22 @@ public Cluster refresh(Context context) { return this; } + public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest) { + serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); + } + + public void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context) { + serviceManager.clusters().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); + } + + public ClusterIdentityResponse createIdentity() { + return serviceManager.clusters().createIdentity(resourceGroupName, clusterName); + } + + public ClusterIdentityResponse createIdentity(Context context) { + return serviceManager.clusters().createIdentity(resourceGroupName, clusterName, context); + } + public ClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -259,6 +289,16 @@ public ClusterImpl withAadTenantId(String aadTenantId) { } } + public ClusterImpl withAadApplicationObjectId(String aadApplicationObjectId) { + this.innerModel().withAadApplicationObjectId(aadApplicationObjectId); + return this; + } + + public ClusterImpl withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) { + this.innerModel().withAadServicePrincipalObjectId(aadServicePrincipalObjectId); + return this; + } + public ClusterImpl withDesiredProperties(ClusterDesiredProperties desiredProperties) { if (isInCreateMode()) { this.innerModel().withDesiredProperties(desiredProperties); diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java index 477957f585e18..58c3e344e1867 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -27,12 +28,19 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.ClusterList; import com.azure.resourcemanager.azurestackhci.models.ClusterPatch; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ClustersClient. */ @@ -136,9 +144,40 @@ Mono> update( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + "/clusters/{clusterName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/uploadCertificate") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> uploadCertificate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UploadCertificateRequest uploadCertificateRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + + "/clusters/{clusterName}/createClusterIdentity") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createIdentity( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -964,7 +1003,7 @@ public Response updateWithResponse( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -1012,7 +1051,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( + private Mono>> deleteWithResponseAsync( String resourceGroupName, String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1046,6 +1085,78 @@ private Mono> deleteWithResponseAsync( context); } + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + /** * Delete an HCI cluster. * @@ -1058,7 +1169,25 @@ private Mono> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String clusterName) { - return deleteWithResponseAsync(resourceGroupName, clusterName).flatMap((Response res) -> Mono.empty()); + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an HCI cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1084,11 +1213,535 @@ public void delete(String resourceGroupName, String clusterName) { * @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. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { - return deleteWithResponseAsync(resourceGroupName, clusterName, context).block(); + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> uploadCertificateWithResponseAsync( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (uploadCertificateRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + } else { + uploadCertificateRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .uploadCertificate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + uploadCertificateRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> uploadCertificateWithResponseAsync( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (uploadCertificateRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter uploadCertificateRequest is required and cannot be null.")); + } else { + uploadCertificateRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .uploadCertificate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + uploadCertificateRequest, + accept, + context); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUploadCertificateAsync( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + Mono>> mono = + uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUploadCertificateAsync( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + uploadCertificateWithResponseAsync(resourceGroupName, clusterName, uploadCertificateRequest, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).getSyncPoller(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + .getSyncPoller(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadCertificateAsync( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadCertificateAsync( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + return beginUploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest).block(); + } + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + uploadCertificateAsync(resourceGroupName, clusterName, uploadCertificateRequest, context).block(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createIdentityWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createIdentity( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return the {@link PollerFlux} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName) { + Mono>> mono = createIdentityWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterIdentityResponseInner.class, + ClusterIdentityResponseInner.class, + this.client.getContext()); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterIdentityResponseInner> beginCreateIdentityAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createIdentityWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterIdentityResponseInner.class, + ClusterIdentityResponseInner.class, + context); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterIdentityResponseInner> beginCreateIdentity( + String resourceGroupName, String clusterName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return cluster Identity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync(String resourceGroupName, String clusterName) { + return beginCreateIdentityAsync(resourceGroupName, clusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIdentityAsync( + String resourceGroupName, String clusterName, Context context) { + return beginCreateIdentityAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName) { + return createIdentityAsync(resourceGroupName, clusterName).block(); + } + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterIdentityResponseInner createIdentity(String resourceGroupName, String clusterName, Context context) { + return createIdentityAsync(resourceGroupName, clusterName, context).block(); } /** diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java index ab6f3ab909b0f..980c49de2240a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ClustersImpl.java @@ -10,9 +10,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.azurestackhci.fluent.ClustersClient; +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterInner; import com.azure.resourcemanager.azurestackhci.models.Cluster; +import com.azure.resourcemanager.azurestackhci.models.ClusterIdentityResponse; import com.azure.resourcemanager.azurestackhci.models.Clusters; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; public final class ClustersImpl implements Clusters { private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); @@ -75,8 +78,40 @@ public void deleteByResourceGroup(String resourceGroupName, String clusterName) this.serviceClient().delete(resourceGroupName, clusterName); } - public Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, clusterName, context); + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest) { + this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest); + } + + public void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context) { + this.serviceClient().uploadCertificate(resourceGroupName, clusterName, uploadCertificateRequest, context); + } + + public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName) { + ClusterIdentityResponseInner inner = this.serviceClient().createIdentity(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context) { + ClusterIdentityResponseInner inner = + this.serviceClient().createIdentity(resourceGroupName, clusterName, context); + if (inner != null) { + return new ClusterIdentityResponseImpl(inner, this.manager()); + } else { + return null; + } } public Cluster getById(String id) { @@ -133,10 +168,10 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - this.deleteWithResponse(resourceGroupName, clusterName, Context.NONE); + this.delete(resourceGroupName, clusterName, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -152,7 +187,7 @@ public Response deleteByIdWithResponse(String id, Context context) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); } - return this.deleteWithResponse(resourceGroupName, clusterName, context); + this.delete(resourceGroupName, clusterName, context); } private ClustersClient serviceClient() { diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java index 6728c51a24287..faacbecbeb5e6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/ExtensionsClientImpl.java @@ -120,7 +120,7 @@ Mono>> create( @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI" + "/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}") - @ExpectedResponses({201}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @HostParam("$host") String endpoint, diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.java new file mode 100644 index 0000000000000..281ace205dd39 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/implementation/PasswordCredentialImpl.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.azurestackhci.implementation; + +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import com.azure.resourcemanager.azurestackhci.models.PasswordCredential; +import java.time.OffsetDateTime; + +public final class PasswordCredentialImpl implements PasswordCredential { + private PasswordCredentialInner innerObject; + + private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager; + + PasswordCredentialImpl( + PasswordCredentialInner innerObject, + com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String secretText() { + return this.innerModel().secretText(); + } + + public String keyId() { + return this.innerModel().keyId(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public PasswordCredentialInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java index 5affedfda7875..2b1410993e7d7 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ActionType.java @@ -24,7 +24,11 @@ public static ActionType fromString(String name) { return fromString(name, ActionType.class); } - /** @return known ActionType values. */ + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ public static Collection values() { return values(ActionType.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.java new file mode 100644 index 0000000000000..970adcaa4bf88 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcIdentityResponse.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.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner; + +/** An immutable client-side representation of ArcIdentityResponse. */ +public interface ArcIdentityResponse { + /** + * Gets the arcApplicationClientId property: The arcApplicationClientId property. + * + * @return the arcApplicationClientId value. + */ + String arcApplicationClientId(); + + /** + * Gets the arcApplicationTenantId property: The arcApplicationTenantId property. + * + * @return the arcApplicationTenantId value. + */ + String arcApplicationTenantId(); + + /** + * Gets the arcServicePrincipalObjectId property: The arcServicePrincipalObjectId property. + * + * @return the arcServicePrincipalObjectId value. + */ + String arcServicePrincipalObjectId(); + + /** + * Gets the arcApplicationObjectId property: The arcApplicationObjectId property. + * + * @return the arcApplicationObjectId value. + */ + String arcApplicationObjectId(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcIdentityResponseInner object. + * + * @return the inner object. + */ + ArcIdentityResponseInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java index d49e0d0cf931a..5c68dad5b0c14 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSetting.java @@ -4,10 +4,12 @@ package com.azure.resourcemanager.azurestackhci.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner; import java.util.List; +import java.util.Map; /** An immutable client-side representation of ArcSetting. */ public interface ArcSetting { @@ -54,6 +56,34 @@ public interface ArcSetting { */ String arcInstanceResourceGroup(); + /** + * Gets the arcApplicationClientId property: App id of arc AAD identity. + * + * @return the arcApplicationClientId value. + */ + String arcApplicationClientId(); + + /** + * Gets the arcApplicationTenantId property: Tenant id of arc AAD identity. + * + * @return the arcApplicationTenantId value. + */ + String arcApplicationTenantId(); + + /** + * Gets the arcServicePrincipalObjectId property: Object id of arc AAD service principal. + * + * @return the arcServicePrincipalObjectId value. + */ + String arcServicePrincipalObjectId(); + + /** + * Gets the arcApplicationObjectId property: Object id of arc AAD identity. + * + * @return the arcApplicationObjectId value. + */ + String arcApplicationObjectId(); + /** * Gets the aggregateState property: Aggregate state of Arc agent across the nodes in this HCI cluster. * @@ -68,6 +98,13 @@ public interface ArcSetting { */ List perNodeDetails(); + /** + * Gets the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + Object connectivityProperties(); + /** * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingInner object. * @@ -99,7 +136,13 @@ interface WithParentResource { * The stage of the ArcSetting definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithArcInstanceResourceGroup { + interface WithCreate + extends DefinitionStages.WithArcInstanceResourceGroup, + DefinitionStages.WithArcApplicationClientId, + DefinitionStages.WithArcApplicationTenantId, + DefinitionStages.WithArcServicePrincipalObjectId, + DefinitionStages.WithArcApplicationObjectId, + DefinitionStages.WithConnectivityProperties { /** * Executes the create request. * @@ -127,6 +170,105 @@ interface WithArcInstanceResourceGroup { */ WithCreate withArcInstanceResourceGroup(String arcInstanceResourceGroup); } + /** The stage of the ArcSetting definition allowing to specify arcApplicationClientId. */ + interface WithArcApplicationClientId { + /** + * Specifies the arcApplicationClientId property: App id of arc AAD identity.. + * + * @param arcApplicationClientId App id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationClientId(String arcApplicationClientId); + } + /** The stage of the ArcSetting definition allowing to specify arcApplicationTenantId. */ + interface WithArcApplicationTenantId { + /** + * Specifies the arcApplicationTenantId property: Tenant id of arc AAD identity.. + * + * @param arcApplicationTenantId Tenant id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationTenantId(String arcApplicationTenantId); + } + /** The stage of the ArcSetting definition allowing to specify arcServicePrincipalObjectId. */ + interface WithArcServicePrincipalObjectId { + /** + * Specifies the arcServicePrincipalObjectId property: Object id of arc AAD service principal.. + * + * @param arcServicePrincipalObjectId Object id of arc AAD service principal. + * @return the next definition stage. + */ + WithCreate withArcServicePrincipalObjectId(String arcServicePrincipalObjectId); + } + /** The stage of the ArcSetting definition allowing to specify arcApplicationObjectId. */ + interface WithArcApplicationObjectId { + /** + * Specifies the arcApplicationObjectId property: Object id of arc AAD identity.. + * + * @param arcApplicationObjectId Object id of arc AAD identity. + * @return the next definition stage. + */ + WithCreate withArcApplicationObjectId(String arcApplicationObjectId); + } + /** The stage of the ArcSetting definition allowing to specify connectivityProperties. */ + interface WithConnectivityProperties { + /** + * Specifies the connectivityProperties property: contains connectivity related configuration for ARC + * resources. + * + * @param connectivityProperties contains connectivity related configuration for ARC resources. + * @return the next definition stage. + */ + WithCreate withConnectivityProperties(Object connectivityProperties); + } + } + /** + * Begins update for the ArcSetting resource. + * + * @return the stage of resource update. + */ + ArcSetting.Update update(); + + /** The template for ArcSetting update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithConnectivityProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ArcSetting apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ArcSetting apply(Context context); + } + /** The ArcSetting update stages. */ + interface UpdateStages { + /** The stage of the ArcSetting update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ArcSetting update allowing to specify connectivityProperties. */ + interface WithConnectivityProperties { + /** + * Specifies the connectivityProperties property: contains connectivity related configuration for ARC + * resources. + * + * @param connectivityProperties contains connectivity related configuration for ARC resources. + * @return the next definition stage. + */ + Update withConnectivityProperties(Object connectivityProperties); + } } /** * Refreshes the resource to sync with Azure. @@ -142,4 +284,44 @@ interface WithArcInstanceResourceGroup { * @return the refreshed resource. */ ArcSetting refresh(Context context); + + /** + * Generate password for arc settings. + * + * @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. + * @return the response. + */ + PasswordCredential generatePassword(); + + /** + * Generate password for arc settings. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response generatePasswordWithResponse(Context context); + + /** + * Create Aad identity for arc settings. + * + * @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. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(); + + /** + * Create Aad identity for arc settings. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java index 938735eabf8af..b784d7a58be9e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingAggregateState.java @@ -66,7 +66,11 @@ public static ArcSettingAggregateState fromString(String name) { return fromString(name, ArcSettingAggregateState.class); } - /** @return known ArcSettingAggregateState values. */ + /** + * Gets known ArcSettingAggregateState values. + * + * @return known ArcSettingAggregateState values. + */ public static Collection values() { return values(ArcSettingAggregateState.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java index 74151c5606070..d58145da942f6 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettings.java @@ -88,6 +88,62 @@ Response getWithResponse( */ void delete(String resourceGroupName, String clusterName, String arcSettingName, Context context); + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return the response. + */ + PasswordCredential generatePassword(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Generate password for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response generatePasswordWithResponse( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity(String resourceGroupName, String clusterName, String arcSettingName); + + /** + * Create Aad identity for arc settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param arcSettingName The name of the proxy resource holding details of HCI ArcSetting information. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return arcIdentity details. + */ + ArcIdentityResponse createIdentity( + String resourceGroupName, String clusterName, String arcSettingName, Context context); + /** * Get ArcSetting resource details of HCI Cluster. * diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java new file mode 100644 index 0000000000000..b9187894e0c5e --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ArcSettingsPatch.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.azurestackhci.fluent.models.ArcSettingsPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** ArcSetting details to update. */ +@Fluent +public final class ArcSettingsPatch { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * ArcSettings properties. + */ + @JsonProperty(value = "properties") + private ArcSettingsPatchProperties innerProperties; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ArcSettingsPatch object itself. + */ + public ArcSettingsPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: ArcSettings properties. + * + * @return the innerProperties value. + */ + private ArcSettingsPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @return the connectivityProperties value. + */ + public Object connectivityProperties() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityProperties(); + } + + /** + * Set the connectivityProperties property: contains connectivity related configuration for ARC resources. + * + * @param connectivityProperties the connectivityProperties value to set. + * @return the ArcSettingsPatch object itself. + */ + public ArcSettingsPatch withConnectivityProperties(Object connectivityProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ArcSettingsPatchProperties(); + } + this.innerProperties().withConnectivityProperties(connectivityProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java index b3ed039c131c7..bc07bef31968d 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Cluster.java @@ -97,6 +97,20 @@ public interface Cluster { */ String aadTenantId(); + /** + * Gets the aadApplicationObjectId property: Object id of cluster AAD identity. + * + * @return the aadApplicationObjectId value. + */ + String aadApplicationObjectId(); + + /** + * Gets the aadServicePrincipalObjectId property: Id of cluster identity service principal. + * + * @return the aadServicePrincipalObjectId value. + */ + String aadServicePrincipalObjectId(); + /** * Gets the desiredProperties property: Desired properties of the cluster. * @@ -146,6 +160,13 @@ public interface Cluster { */ OffsetDateTime lastBillingTimestamp(); + /** + * Gets the serviceEndpoint property: Region specific DataPath Endpoint of the cluster. + * + * @return the serviceEndpoint value. + */ + String serviceEndpoint(); + /** * Gets the region of the resource. * @@ -216,6 +237,8 @@ interface WithCreate DefinitionStages.WithCloudManagementEndpoint, DefinitionStages.WithAadClientId, DefinitionStages.WithAadTenantId, + DefinitionStages.WithAadApplicationObjectId, + DefinitionStages.WithAadServicePrincipalObjectId, DefinitionStages.WithDesiredProperties { /** * Executes the create request. @@ -273,6 +296,26 @@ interface WithAadTenantId { */ WithCreate withAadTenantId(String aadTenantId); } + /** The stage of the Cluster definition allowing to specify aadApplicationObjectId. */ + interface WithAadApplicationObjectId { + /** + * Specifies the aadApplicationObjectId property: Object id of cluster AAD identity.. + * + * @param aadApplicationObjectId Object id of cluster AAD identity. + * @return the next definition stage. + */ + WithCreate withAadApplicationObjectId(String aadApplicationObjectId); + } + /** The stage of the Cluster definition allowing to specify aadServicePrincipalObjectId. */ + interface WithAadServicePrincipalObjectId { + /** + * Specifies the aadServicePrincipalObjectId property: Id of cluster identity service principal.. + * + * @param aadServicePrincipalObjectId Id of cluster identity service principal. + * @return the next definition stage. + */ + WithCreate withAadServicePrincipalObjectId(String aadServicePrincipalObjectId); + } /** The stage of the Cluster definition allowing to specify desiredProperties. */ interface WithDesiredProperties { /** @@ -380,4 +423,45 @@ interface WithDesiredProperties { * @return the refreshed resource. */ Cluster refresh(Context context); + + /** + * Upload certificate. + * + * @param uploadCertificateRequest Upload certificate request. + * @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. + */ + void uploadCertificate(UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate(UploadCertificateRequest uploadCertificateRequest, Context context); + + /** + * Create cluster identity. + * + * @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. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(); + + /** + * Create cluster identity. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(Context context); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.java new file mode 100644 index 0000000000000..296b523f8462d --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ClusterIdentityResponse.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.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner; + +/** An immutable client-side representation of ClusterIdentityResponse. */ +public interface ClusterIdentityResponse { + /** + * Gets the aadClientId property: The aadClientId property. + * + * @return the aadClientId value. + */ + String aadClientId(); + + /** + * Gets the aadTenantId property: The aadTenantId property. + * + * @return the aadTenantId value. + */ + String aadTenantId(); + + /** + * Gets the aadServicePrincipalObjectId property: The aadServicePrincipalObjectId property. + * + * @return the aadServicePrincipalObjectId value. + */ + String aadServicePrincipalObjectId(); + + /** + * Gets the aadApplicationObjectId property: The aadApplicationObjectId property. + * + * @return the aadApplicationObjectId value. + */ + String aadApplicationObjectId(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.ClusterIdentityResponseInner object. + * + * @return the inner object. + */ + ClusterIdentityResponseInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java index 27e656f123c11..989e69c94dfca 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Clusters.java @@ -98,9 +98,63 @@ public interface Clusters { * @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. - * @return the {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String clusterName, Context context); + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + */ + void uploadCertificate( + String resourceGroupName, String clusterName, UploadCertificateRequest uploadCertificateRequest); + + /** + * Upload certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param uploadCertificateRequest Upload certificate request. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void uploadCertificate( + String resourceGroupName, + String clusterName, + UploadCertificateRequest uploadCertificateRequest, + Context context); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName); + + /** + * Create cluster identity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster Identity details. + */ + ClusterIdentityResponse createIdentity(String resourceGroupName, String clusterName, Context context); /** * Get HCI cluster. @@ -143,9 +197,8 @@ public interface Clusters { * @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. - * @return the {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Cluster resource. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java index c7fe777fde3c7..055016a21b28a 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/DiagnosticLevel.java @@ -30,7 +30,11 @@ public static DiagnosticLevel fromString(String name) { return fromString(name, DiagnosticLevel.class); } - /** @return known DiagnosticLevel values. */ + /** + * Gets known DiagnosticLevel values. + * + * @return known DiagnosticLevel values. + */ public static Collection values() { return values(DiagnosticLevel.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java index ee6bd61725ef4..23c5dfbc409d0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ExtensionAggregateState.java @@ -66,7 +66,11 @@ public static ExtensionAggregateState fromString(String name) { return fromString(name, ExtensionAggregateState.class); } - /** @return known ExtensionAggregateState values. */ + /** + * Gets known ExtensionAggregateState values. + * + * @return known ExtensionAggregateState values. + */ public static Collection values() { return values(ExtensionAggregateState.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java index cdc208bc6e7e9..c3ca4a6a0bcfe 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ImdsAttestation.java @@ -27,7 +27,11 @@ public static ImdsAttestation fromString(String name) { return fromString(name, ImdsAttestation.class); } - /** @return known ImdsAttestation values. */ + /** + * Gets known ImdsAttestation values. + * + * @return known ImdsAttestation values. + */ public static Collection values() { return values(ImdsAttestation.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java index 3548460199641..c4f967773edf3 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeArcState.java @@ -57,7 +57,11 @@ public static NodeArcState fromString(String name) { return fromString(name, NodeArcState.class); } - /** @return known NodeArcState values. */ + /** + * Gets known NodeArcState values. + * + * @return known NodeArcState values. + */ public static Collection values() { return values(NodeArcState.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java index ae9b97b6c5472..c3394d36855f4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/NodeExtensionState.java @@ -57,7 +57,11 @@ public static NodeExtensionState fromString(String name) { return fromString(name, NodeExtensionState.class); } - /** @return known NodeExtensionState values. */ + /** + * Gets known NodeExtensionState values. + * + * @return known NodeExtensionState values. + */ public static Collection values() { return values(NodeExtensionState.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java index 9762cce2c3792..5eb928fb9ec93 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Origin.java @@ -30,7 +30,11 @@ public static Origin fromString(String name) { return fromString(name, Origin.class); } - /** @return known Origin values. */ + /** + * Gets known Origin values. + * + * @return known Origin values. + */ public static Collection values() { return values(Origin.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.java new file mode 100644 index 0000000000000..ed82f484e14ff --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/PasswordCredential.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.azurestackhci.models; + +import com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of PasswordCredential. */ +public interface PasswordCredential { + /** + * Gets the secretText property: The secretText property. + * + * @return the secretText value. + */ + String secretText(); + + /** + * Gets the keyId property: The keyId property. + * + * @return the keyId value. + */ + String keyId(); + + /** + * Gets the startDateTime property: The startDateTime property. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: The endDateTime property. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.azurestackhci.fluent.models.PasswordCredentialInner object. + * + * @return the inner object. + */ + PasswordCredentialInner innerModel(); +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java index f0a551b5c4fd5..117f3584ed155 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/ProvisioningState.java @@ -36,7 +36,11 @@ public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } - /** @return known ProvisioningState values. */ + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ public static Collection values() { return values(ProvisioningState.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.java new file mode 100644 index 0000000000000..5cb214a9d881a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/RawCertificateData.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RawCertificateData model. */ +@Fluent +public final class RawCertificateData { + /* + * The certificates property. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /** + * Get the certificates property: The certificates property. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The certificates property. + * + * @param certificates the certificates value to set. + * @return the RawCertificateData object itself. + */ + public RawCertificateData withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java index 67354499433da..91733d95bf457 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/Status.java @@ -36,7 +36,11 @@ public static Status fromString(String name) { return fromString(name, Status.class); } - /** @return known Status values. */ + /** + * Gets known Status values. + * + * @return known Status values. + */ public static Collection values() { return values(Status.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.java new file mode 100644 index 0000000000000..8fabb105a6622 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/UploadCertificateRequest.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.azurestackhci.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UploadCertificateRequest model. */ +@Fluent +public final class UploadCertificateRequest { + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private RawCertificateData properties; + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public RawCertificateData properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withProperties(RawCertificateData properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java index 28701e4307f77..6d9da4e53ba78 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/main/java/com/azure/resourcemanager/azurestackhci/models/WindowsServerSubscription.java @@ -27,7 +27,11 @@ public static WindowsServerSubscription fromString(String name) { return fromString(name, WindowsServerSubscription.class); } - /** @return known WindowsServerSubscription values. */ + /** + * Gets known WindowsServerSubscription values. + * + * @return known WindowsServerSubscription values. + */ public static Collection values() { return values(WindowsServerSubscription.class); } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.java new file mode 100644 index 0000000000000..47e9f75aa33b3 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateIdentitySamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for ArcSettings CreateIdentity. */ +public final class ArcSettingsCreateIdentitySamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateArcIdentity.json + */ + /** + * Sample code: Create Arc Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createArcIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().createIdentity("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java index e1a01d454da14..b0da37f7e07eb 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for ArcSettings Create. */ public final class ArcSettingsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/PutArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutArcSetting.json */ /** * Sample code: Create ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java index 85c3499d15380..dd70b83175554 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings Delete. */ public final class ArcSettingsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/DeleteArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteArcSetting.json */ /** * Sample code: Delete ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.java new file mode 100644 index 0000000000000..066deffefc05c --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGeneratePasswordSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for ArcSettings GeneratePassword. */ +public final class ArcSettingsGeneratePasswordSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GeneratePassword.json + */ + /** + * Sample code: Generate Password. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void generatePassword(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.arcSettings().generatePasswordWithResponse("test-rg", "myCluster", "default", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java index 12316880705dc..9b49a686cf00e 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings Get. */ public final class ArcSettingsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/GetArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetArcSetting.json */ /** * Sample code: Get ArcSetting. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java index a5c38b1fd66c8..840759606cea0 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsListByClusterSamples.java @@ -9,7 +9,7 @@ /** Samples for ArcSettings ListByCluster. */ public final class ArcSettingsListByClusterSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListArcSettingsByCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListArcSettingsByCluster.json */ /** * Sample code: List ArcSetting resources by HCI Cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.java new file mode 100644 index 0000000000000..bfc08f7891a47 --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ArcSettingsUpdateSamples.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.azurestackhci.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.azurestackhci.models.ArcSetting; +import java.io.IOException; + +/** Samples for ArcSettings Update. */ +public final class ArcSettingsUpdateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchArcSetting.json + */ + /** + * Sample code: Patch ArcSetting. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void patchArcSetting(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) + throws IOException { + ArcSetting resource = + manager.arcSettings().getWithResponse("test-rg", "myCluster", "default", Context.NONE).getValue(); + resource + .update() + .withConnectivityProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{\"enabled\":true}", Object.class, SerializerEncoding.JSON)) + .apply(); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.java new file mode 100644 index 0000000000000..076cc9c75fbce --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateIdentitySamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; + +/** Samples for Clusters CreateIdentity. */ +public final class ClustersCreateIdentitySamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateClusterIdentity.json + */ + /** + * Sample code: Create cluster Identity. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void createClusterIdentity(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager.clusters().createIdentity("test-rg", "myCluster", Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java index 09a74f8130853..2e5a4bc4c68c1 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for Clusters Create. */ public final class ClustersCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/CreateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/CreateCluster.json */ /** * Sample code: Create cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java index 2ae6b40f1501c..087f8a22c28b4 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters Delete. */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/DeleteCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteCluster.json */ /** * Sample code: Delete cluster. @@ -17,6 +17,6 @@ public final class ClustersDeleteSamples { * @param manager Entry point to AzureStackHciManager. */ public static void deleteCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { - manager.clusters().deleteWithResponse("test-rg", "myCluster", Context.NONE); + manager.clusters().delete("test-rg", "myCluster", Context.NONE); } } diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java index d35ea091f0011..fb08e4f84c922 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters GetByResourceGroup. */ public final class ClustersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/GetCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetCluster.json */ /** * Sample code: Get cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java index a4f4ae3262e86..3bdd3e7609713 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters ListByResourceGroup. */ public final class ClustersListByResourceGroupSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListClustersByResourceGroup.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersByResourceGroup.json */ /** * Sample code: List clusters in a given resource group. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java index 31107a77bdae1..2d619de3c1662 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersListSamples.java @@ -9,7 +9,7 @@ /** Samples for Clusters List. */ public final class ClustersListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListClustersBySubscription.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListClustersBySubscription.json */ /** * Sample code: List clusters in a given subscription. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java index b09068272cd12..0604ed772ffc9 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUpdateSamples.java @@ -15,7 +15,7 @@ /** Samples for Clusters Update. */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/UpdateCluster.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UpdateCluster.json */ /** * Sample code: Update cluster. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.java new file mode 100644 index 0000000000000..e0b951ddce12a --- /dev/null +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ClustersUploadCertificateSamples.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.azurestackhci.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.azurestackhci.models.RawCertificateData; +import com.azure.resourcemanager.azurestackhci.models.UploadCertificateRequest; +import java.util.Arrays; + +/** Samples for Clusters UploadCertificate. */ +public final class ClustersUploadCertificateSamples { + /* + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/UploadCertificate.json + */ + /** + * Sample code: Upload certificate. + * + * @param manager Entry point to AzureStackHciManager. + */ + public static void uploadCertificate(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + manager + .clusters() + .uploadCertificate( + "test-rg", + "myCluster", + new UploadCertificateRequest() + .withProperties( + new RawCertificateData().withCertificates(Arrays.asList("base64cert", "base64cert"))), + Context.NONE); + } +} diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java index 70a38e5011962..b25518c9e8777 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsCreateSamples.java @@ -11,7 +11,7 @@ /** Samples for Extensions Create. */ public final class ExtensionsCreateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/PutExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PutExtension.json */ /** * Sample code: Create Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java index 32d3286cde030..e89be94c7633b 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions Delete. */ public final class ExtensionsDeleteSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/DeleteExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/DeleteExtension.json */ /** * Sample code: Delete Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java index 714fc5b9279e7..6cf05532d2646 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions Get. */ public final class ExtensionsGetSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/GetExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/GetExtension.json */ /** * Sample code: Get ArcSettings Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java index d581ff60c871c..8206a6b61cd70 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsListByArcSettingSamples.java @@ -9,7 +9,7 @@ /** Samples for Extensions ListByArcSetting. */ public final class ExtensionsListByArcSettingSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListExtensionsByArcSetting.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListExtensionsByArcSetting.json */ /** * Sample code: List Extensions under ArcSetting resource. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java index 0b7654bae4fa5..382bea80ca758 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/ExtensionsUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for Extensions Update. */ public final class ExtensionsUpdateSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/PatchExtension.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/PatchExtension.json */ /** * Sample code: Update Arc Extension. diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java index 71d17b553dc20..7dc158cda4c3c 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/src/samples/java/com/azure/resourcemanager/azurestackhci/generated/OperationsListSamples.java @@ -9,15 +9,14 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-01-01/examples/ListOperations.json + * x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2022-05-01/examples/ListOperations.json */ /** - * Sample code: List operations available with the Microsoft.AzureStackHCI provider. + * Sample code: Create cluster. * * @param manager Entry point to AzureStackHciManager. */ - public static void listOperationsAvailableWithTheMicrosoftAzureStackHCIProvider( - com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { + public static void createCluster(com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager) { manager.operations().listWithResponse(Context.NONE); } }