diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c434d9a91d5a..2a3bdc7cdf0e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -410,6 +410,7 @@ com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-qumulo;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-networkcloud;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index f893e1394407..40b007aa8d6a 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,7 @@ sdk/mysql sdk/mysqlflexibleserver sdk/netapp + sdk/networkcloud sdk/networkfunction sdk/newrelicobservability sdk/nginx diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md b/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md new file mode 100644 index 000000000000..4f3b4e1213d3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-05-08) + +- Azure Resource Manager NetworkCloud client library for Java. This package contains Microsoft Azure SDK for NetworkCloud Management SDK. The Network Cloud APIs provide management of the on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. Package tag package-2022-12-12-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md b/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md new file mode 100644 index 000000000000..ce1597f7deed --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager NetworkCloud client library for Java + +Azure Resource Manager NetworkCloud client library for Java. + +This package contains Microsoft Azure SDK for NetworkCloud Management SDK. The Network Cloud APIs provide management of the on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. Package tag package-2022-12-12-preview. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-networkcloud;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-networkcloud + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +NetworkCloudManager manager = NetworkCloudManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md b/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md new file mode 100644 index 000000000000..2678f9a0b698 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/SAMPLE.md @@ -0,0 +1,4188 @@ +# Code snippets and samples + + +## BareMetalMachineKeySets + +- [CreateOrUpdate](#baremetalmachinekeysets_createorupdate) +- [Delete](#baremetalmachinekeysets_delete) +- [Get](#baremetalmachinekeysets_get) +- [ListByResourceGroup](#baremetalmachinekeysets_listbyresourcegroup) +- [Update](#baremetalmachinekeysets_update) + +## BareMetalMachines + +- [Cordon](#baremetalmachines_cordon) +- [CreateOrUpdate](#baremetalmachines_createorupdate) +- [Delete](#baremetalmachines_delete) +- [GetByResourceGroup](#baremetalmachines_getbyresourcegroup) +- [List](#baremetalmachines_list) +- [ListByResourceGroup](#baremetalmachines_listbyresourcegroup) +- [PowerOff](#baremetalmachines_poweroff) +- [Reimage](#baremetalmachines_reimage) +- [Replace](#baremetalmachines_replace) +- [Restart](#baremetalmachines_restart) +- [RunCommand](#baremetalmachines_runcommand) +- [RunDataExtracts](#baremetalmachines_rundataextracts) +- [RunReadCommands](#baremetalmachines_runreadcommands) +- [Start](#baremetalmachines_start) +- [Uncordon](#baremetalmachines_uncordon) +- [Update](#baremetalmachines_update) +- [ValidateHardware](#baremetalmachines_validatehardware) + +## BmcKeySets + +- [CreateOrUpdate](#bmckeysets_createorupdate) +- [Delete](#bmckeysets_delete) +- [Get](#bmckeysets_get) +- [ListByResourceGroup](#bmckeysets_listbyresourcegroup) +- [Update](#bmckeysets_update) + +## CloudServicesNetworks + +- [CreateOrUpdate](#cloudservicesnetworks_createorupdate) +- [Delete](#cloudservicesnetworks_delete) +- [GetByResourceGroup](#cloudservicesnetworks_getbyresourcegroup) +- [List](#cloudservicesnetworks_list) +- [ListByResourceGroup](#cloudservicesnetworks_listbyresourcegroup) +- [Update](#cloudservicesnetworks_update) + +## ClusterManagers + +- [CreateOrUpdate](#clustermanagers_createorupdate) +- [Delete](#clustermanagers_delete) +- [GetByResourceGroup](#clustermanagers_getbyresourcegroup) +- [List](#clustermanagers_list) +- [ListByResourceGroup](#clustermanagers_listbyresourcegroup) +- [Update](#clustermanagers_update) + +## Clusters + +- [CreateOrUpdate](#clusters_createorupdate) +- [Delete](#clusters_delete) +- [Deploy](#clusters_deploy) +- [GetByResourceGroup](#clusters_getbyresourcegroup) +- [List](#clusters_list) +- [ListByResourceGroup](#clusters_listbyresourcegroup) +- [Update](#clusters_update) +- [UpdateVersion](#clusters_updateversion) + +## Consoles + +- [CreateOrUpdate](#consoles_createorupdate) +- [Delete](#consoles_delete) +- [Get](#consoles_get) +- [ListByResourceGroup](#consoles_listbyresourcegroup) +- [Update](#consoles_update) + +## DefaultCniNetworks + +- [CreateOrUpdate](#defaultcninetworks_createorupdate) +- [Delete](#defaultcninetworks_delete) +- [GetByResourceGroup](#defaultcninetworks_getbyresourcegroup) +- [List](#defaultcninetworks_list) +- [ListByResourceGroup](#defaultcninetworks_listbyresourcegroup) +- [Update](#defaultcninetworks_update) + +## HybridAksClusters + +- [CreateOrUpdate](#hybridaksclusters_createorupdate) +- [Delete](#hybridaksclusters_delete) +- [GetByResourceGroup](#hybridaksclusters_getbyresourcegroup) +- [List](#hybridaksclusters_list) +- [ListByResourceGroup](#hybridaksclusters_listbyresourcegroup) +- [RestartNode](#hybridaksclusters_restartnode) +- [Update](#hybridaksclusters_update) + +## L2Networks + +- [CreateOrUpdate](#l2networks_createorupdate) +- [Delete](#l2networks_delete) +- [GetByResourceGroup](#l2networks_getbyresourcegroup) +- [List](#l2networks_list) +- [ListByResourceGroup](#l2networks_listbyresourcegroup) +- [Update](#l2networks_update) + +## L3Networks + +- [CreateOrUpdate](#l3networks_createorupdate) +- [Delete](#l3networks_delete) +- [GetByResourceGroup](#l3networks_getbyresourcegroup) +- [List](#l3networks_list) +- [ListByResourceGroup](#l3networks_listbyresourcegroup) +- [Update](#l3networks_update) + +## MetricsConfigurations + +- [CreateOrUpdate](#metricsconfigurations_createorupdate) +- [Delete](#metricsconfigurations_delete) +- [Get](#metricsconfigurations_get) +- [ListByResourceGroup](#metricsconfigurations_listbyresourcegroup) +- [Update](#metricsconfigurations_update) + +## Operations + +- [List](#operations_list) + +## RackSkus + +- [Get](#rackskus_get) +- [List](#rackskus_list) + +## Racks + +- [CreateOrUpdate](#racks_createorupdate) +- [Delete](#racks_delete) +- [GetByResourceGroup](#racks_getbyresourcegroup) +- [List](#racks_list) +- [ListByResourceGroup](#racks_listbyresourcegroup) +- [Update](#racks_update) + +## StorageAppliances + +- [CreateOrUpdate](#storageappliances_createorupdate) +- [Delete](#storageappliances_delete) +- [DisableRemoteVendorManagement](#storageappliances_disableremotevendormanagement) +- [EnableRemoteVendorManagement](#storageappliances_enableremotevendormanagement) +- [GetByResourceGroup](#storageappliances_getbyresourcegroup) +- [List](#storageappliances_list) +- [ListByResourceGroup](#storageappliances_listbyresourcegroup) +- [RunReadCommands](#storageappliances_runreadcommands) +- [Update](#storageappliances_update) +- [ValidateHardware](#storageappliances_validatehardware) + +## TrunkedNetworks + +- [CreateOrUpdate](#trunkednetworks_createorupdate) +- [Delete](#trunkednetworks_delete) +- [GetByResourceGroup](#trunkednetworks_getbyresourcegroup) +- [List](#trunkednetworks_list) +- [ListByResourceGroup](#trunkednetworks_listbyresourcegroup) +- [Update](#trunkednetworks_update) + +## VirtualMachines + +- [AttachVolume](#virtualmachines_attachvolume) +- [CreateOrUpdate](#virtualmachines_createorupdate) +- [Delete](#virtualmachines_delete) +- [DetachVolume](#virtualmachines_detachvolume) +- [GetByResourceGroup](#virtualmachines_getbyresourcegroup) +- [List](#virtualmachines_list) +- [ListByResourceGroup](#virtualmachines_listbyresourcegroup) +- [PowerOff](#virtualmachines_poweroff) +- [Reimage](#virtualmachines_reimage) +- [Restart](#virtualmachines_restart) +- [Start](#virtualmachines_start) +- [Update](#virtualmachines_update) + +## Volumes + +- [CreateOrUpdate](#volumes_createorupdate) +- [Delete](#volumes_delete) +- [GetByResourceGroup](#volumes_getbyresourcegroup) +- [List](#volumes_list) +- [ListByResourceGroup](#volumes_listbyresourcegroup) +- [Update](#volumes_update) +### BareMetalMachineKeySets_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachineKeySets CreateOrUpdate. */ +public final class BareMetalMachineKeySetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json + */ + /** + * Sample code: Create or update bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .define("bareMetalMachineKeySetName") + .withRegion("location") + .withExistingCluster("resourceGroupName", "clusterName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) + .withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel.STANDARD) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withOsGroupName("standardAccessGroup") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BareMetalMachineKeySets_Delete + +```java +/** Samples for BareMetalMachineKeySets Delete. */ +public final class BareMetalMachineKeySetsDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json + */ + /** + * Sample code: Delete bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .delete("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachineKeySets_Get + +```java +/** Samples for BareMetalMachineKeySets Get. */ +public final class BareMetalMachineKeySetsGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json + */ + /** + * Sample code: Get bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .getWithResponse( + "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachineKeySets_ListByResourceGroup + +```java +/** Samples for BareMetalMachineKeySets ListByResourceGroup. */ +public final class BareMetalMachineKeySetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json + */ + /** + * Sample code: List bare metal machine key set of cluster for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBareMetalMachineKeySetOfClusterForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .listByResourceGroup("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachineKeySets_Update + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySet; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachineKeySets Update. */ +public final class BareMetalMachineKeySetsUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json + */ + /** + * Sample code: Patch bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BareMetalMachineKeySet resource = + manager + .bareMetalMachineKeySets() + .getWithResponse( + "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BareMetalMachines_Cordon + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineEvacuate; + +/** Samples for BareMetalMachines Cordon. */ +public final class BareMetalMachinesCordonSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json + */ + /** + * Sample code: Cordon bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void cordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .cordon( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineCordonParameters().withEvacuate(BareMetalMachineEvacuate.TRUE), + com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachines CreateOrUpdate. */ +public final class BareMetalMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json + */ + /** + * Sample code: Create or update bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .define("bareMetalMachineName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withBmcConnectionString("bmcconnectionstring") + .withBmcCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) + .withBmcMacAddress("00:00:4f:00:57:00") + .withBootMacAddress("00:00:4e:00:58:af") + .withMachineDetails("User-provided machine details.") + .withMachineName("r01c001") + .withMachineSkuId("684E-3B16-399E") + .withRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BareMetalMachines_Delete + +```java +/** Samples for BareMetalMachines Delete. */ +public final class BareMetalMachinesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json + */ + /** + * Sample code: Delete bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .delete("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_GetByResourceGroup + +```java +/** Samples for BareMetalMachines GetByResourceGroup. */ +public final class BareMetalMachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json + */ + /** + * Sample code: Get bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_List + +```java +/** Samples for BareMetalMachines List. */ +public final class BareMetalMachinesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json + */ + /** + * Sample code: List bare metal machines for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBareMetalMachinesForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines().list(com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_ListByResourceGroup + +```java +/** Samples for BareMetalMachines ListByResourceGroup. */ +public final class BareMetalMachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json + */ + /** + * Sample code: List bare metal machines for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBareMetalMachinesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_PowerOff + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineSkipShutdown; + +/** Samples for BareMetalMachines PowerOff. */ +public final class BareMetalMachinesPowerOffSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json + */ + /** + * Sample code: Power off bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void powerOffBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .powerOff( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachinePowerOffParameters().withSkipShutdown(BareMetalMachineSkipShutdown.TRUE), + com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_Reimage + +```java +/** Samples for BareMetalMachines Reimage. */ +public final class BareMetalMachinesReimageSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json + */ + /** + * Sample code: Reimage bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void reimageBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .reimage("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_Replace + +```java +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; + +/** Samples for BareMetalMachines Replace. */ +public final class BareMetalMachinesReplaceSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json + */ + /** + * Sample code: Replace bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void replaceBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .replace( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineReplaceParameters() + .withBmcCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) + .withBmcMacAddress("00:00:4f:00:57:ad") + .withBootMacAddress("00:00:4e:00:58:af") + .withMachineName("name") + .withSerialNumber("BM1219XXX"), + com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_Restart + +```java +/** Samples for BareMetalMachines Restart. */ +public final class BareMetalMachinesRestartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json + */ + /** + * Sample code: Restart bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void restartBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .restart("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_RunCommand + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; +import java.util.Arrays; + +/** Samples for BareMetalMachines RunCommand. */ +public final class BareMetalMachinesRunCommandSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json + */ + /** + * Sample code: Run command on bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runCommandOnBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .runCommand( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineRunCommandParameters() + .withArguments(Arrays.asList("--argument1", "argument2")) + .withLimitTimeSeconds(60L) + .withScript("cHdkCg=="), + com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_RunDataExtracts + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; +import java.util.Arrays; + +/** Samples for BareMetalMachines RunDataExtracts. */ +public final class BareMetalMachinesRunDataExtractsSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json + */ + /** + * Sample code: Run data extraction on bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runDataExtractionOnBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .runDataExtracts( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineRunDataExtractsParameters() + .withCommands(Arrays.asList(new BareMetalMachineCommandSpecification().withCommand("networkInfo"))) + .withLimitTimeSeconds(60L), + com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_RunReadCommands + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; +import java.util.Arrays; + +/** Samples for BareMetalMachines RunReadCommands. */ +public final class BareMetalMachinesRunReadCommandsSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json + */ + /** + * Sample code: Run and retrieve output from read only commands on bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .runReadCommands( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineRunReadCommandsParameters() + .withCommands( + Arrays + .asList( + new BareMetalMachineCommandSpecification() + .withArguments(Arrays.asList("pods", "-A")) + .withCommand("kubectl get"), + new BareMetalMachineCommandSpecification() + .withArguments(Arrays.asList("192.168.0.99", "-c", "3")) + .withCommand("ping"))) + .withLimitTimeSeconds(60L), + com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_Start + +```java +/** Samples for BareMetalMachines Start. */ +public final class BareMetalMachinesStartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json + */ + /** + * Sample code: Start bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void startBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .start("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_Uncordon + +```java +/** Samples for BareMetalMachines Uncordon. */ +public final class BareMetalMachinesUncordonSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json + */ + /** + * Sample code: Uncordon bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void uncordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .uncordon("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### BareMetalMachines_Update + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachine; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachines Update. */ +public final class BareMetalMachinesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json + */ + /** + * Sample code: Patch bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BareMetalMachine resource = + manager + .bareMetalMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withMachineDetails("machinedetails") + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BareMetalMachines_ValidateHardware + +```java +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineHardwareValidationCategory; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineValidateHardwareParameters; + +/** Samples for BareMetalMachines ValidateHardware. */ +public final class BareMetalMachinesValidateHardwareSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json + */ + /** + * Sample code: Validate the bare metal machine hardware. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void validateTheBareMetalMachineHardware( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .validateHardware( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineValidateHardwareParameters() + .withValidationCategory(BareMetalMachineHardwareValidationCategory.BASIC_VALIDATION), + com.azure.core.util.Context.NONE); + } +} +``` + +### BmcKeySets_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BmcKeySets CreateOrUpdate. */ +public final class BmcKeySetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json + */ + /** + * Sample code: Create or update baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bmcKeySets() + .define("bmcKeySetName") + .withRegion("location") + .withExistingCluster("resourceGroupName", "clusterName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withPrivilegeLevel(BmcKeySetPrivilegeLevel.ADMINISTRATOR) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BmcKeySets_Delete + +```java +/** Samples for BmcKeySets Delete. */ +public final class BmcKeySetsDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json + */ + /** + * Sample code: Delete baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bmcKeySets() + .delete("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); + } +} +``` + +### BmcKeySets_Get + +```java +/** Samples for BmcKeySets Get. */ +public final class BmcKeySetsGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json + */ + /** + * Sample code: Get baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bmcKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); + } +} +``` + +### BmcKeySets_ListByResourceGroup + +```java +/** Samples for BmcKeySets ListByResourceGroup. */ +public final class BmcKeySetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json + */ + /** + * Sample code: List baseboard management controller key set of cluster for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBaseboardManagementControllerKeySetOfClusterForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bmcKeySets().listByResourceGroup("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### BmcKeySets_Update + +```java +import com.azure.resourcemanager.networkcloud.models.BmcKeySet; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BmcKeySets Update. */ +public final class BmcKeySetsUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json + */ + /** + * Sample code: Patch baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BmcKeySet resource = + manager + .bmcKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CloudServicesNetworks_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.azure.resourcemanager.networkcloud.models.EndpointDependency; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CloudServicesNetworks CreateOrUpdate. */ +public final class CloudServicesNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json + */ + /** + * Sample code: Create or update cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateCloudServicesNetwork( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .cloudServicesNetworks() + .define("cloudServicesNetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAdditionalEgressEndpoints( + Arrays + .asList( + new EgressEndpoint() + .withCategory("azure-resource-management") + .withEndpoints( + Arrays + .asList( + new EndpointDependency() + .withDomainName("https://storageaccountex.blob.core.windows.net") + .withPort(443L))))) + .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CloudServicesNetworks_Delete + +```java +/** Samples for CloudServicesNetworks Delete. */ +public final class CloudServicesNetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json + */ + /** + * Sample code: Delete cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .cloudServicesNetworks() + .delete("resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServicesNetworks_GetByResourceGroup + +```java +/** Samples for CloudServicesNetworks GetByResourceGroup. */ +public final class CloudServicesNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json + */ + /** + * Sample code: Get cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .cloudServicesNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServicesNetworks_List + +```java +/** Samples for CloudServicesNetworks List. */ +public final class CloudServicesNetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json + */ + /** + * Sample code: List cloud services networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listCloudServicesNetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.cloudServicesNetworks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServicesNetworks_ListByResourceGroup + +```java +/** Samples for CloudServicesNetworks ListByResourceGroup. */ +public final class CloudServicesNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json + */ + /** + * Sample code: List cloud services networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listCloudServicesNetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.cloudServicesNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudServicesNetworks_Update + +```java +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.azure.resourcemanager.networkcloud.models.EndpointDependency; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CloudServicesNetworks Update. */ +public final class CloudServicesNetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json + */ + /** + * Sample code: Patch cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + CloudServicesNetwork resource = + manager + .cloudServicesNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAdditionalEgressEndpoints( + Arrays + .asList( + new EgressEndpoint() + .withCategory("azure-resource-management") + .withEndpoints( + Arrays + .asList( + new EndpointDependency() + .withDomainName("https://storageaccountex.blob.core.windows.net") + .withPort(443L))))) + .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ClusterManagers_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterManagers CreateOrUpdate. */ +public final class ClusterManagersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json + */ + /** + * Sample code: Create or update cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateClusterManager( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusterManagers() + .define("clusterManagerName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withFabricControllerId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAnalyticsWorkspaceId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ClusterManagers_Delete + +```java +/** Samples for ClusterManagers Delete. */ +public final class ClusterManagersDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json + */ + /** + * Sample code: Delete cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers().delete("resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterManagers_GetByResourceGroup + +```java +/** Samples for ClusterManagers GetByResourceGroup. */ +public final class ClusterManagersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json + */ + /** + * Sample code: Get cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusterManagers() + .getByResourceGroupWithResponse( + "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterManagers_List + +```java +/** Samples for ClusterManagers List. */ +public final class ClusterManagersListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json + */ + /** + * Sample code: List cluster managers for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClusterManagersForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterManagers_ListByResourceGroup + +```java +/** Samples for ClusterManagers ListByResourceGroup. */ +public final class ClusterManagersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json + */ + /** + * Sample code: List cluster managers for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClusterManagersForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterManagers_Update + +```java +import com.azure.resourcemanager.networkcloud.models.ClusterManager; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterManagers Update. */ +public final class ClusterManagersUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json + */ + /** + * Sample code: Patch cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + ClusterManager resource = + manager + .clusterManagers() + .getByResourceGroupWithResponse( + "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Clusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; +import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters CreateOrUpdate. */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json + */ + /** + * Sample code: Create or update cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .define("clusterName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) + .withAggregatorOrSingleRackDefinition( + new RackDefinition() + .withBareMetalMachineConfigurationData( + Arrays + .asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("AA1234") + .withRackSkuId( + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData( + Arrays + .asList( + new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) + .withAnalyticsWorkspaceId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withClusterType(ClusterType.SINGLE_RACK) + .withClusterVersion("1.0.0") + .withNetworkFabricId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withClusterLocation("Foo Street, 3rd Floor, row 9") + .withClusterServicePrincipal( + new ServicePrincipalInformation() + .withApplicationId("12345678-1234-1234-1234-123456789012") + .withPassword("fakeTokenPlaceholder") + .withPrincipalId("00000008-0004-0004-0004-000000000012") + .withTenantId("80000000-4000-4000-4000-120000000000")) + .withComputeDeploymentThreshold( + new ValidationThreshold() + .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + .withType(ValidationThresholdType.PERCENT_SUCCESS) + .withValue(90L)) + .withComputeRackDefinitions( + Arrays + .asList( + new RackDefinition() + .withBareMetalMachineConfigurationData( + Arrays + .asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("AA1234") + .withRackSkuId( + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData( + Arrays + .asList( + new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName"))))) + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Clusters_Delete + +```java +/** Samples for Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json + */ + /** + * Sample code: Delete cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters().delete("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Deploy + +```java +import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import java.util.Arrays; + +/** Samples for Clusters Deploy. */ +public final class ClustersDeploySamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json + */ + /** + * Sample code: Deploy cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deployCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .deploy( + "resourceGroupName", "clusterName", new ClusterDeployParameters(), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy_SkipValidation.json + */ + /** + * Sample code: Deploy cluster skipping validation. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deployClusterSkippingValidation( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .deploy( + "resourceGroupName", + "clusterName", + new ClusterDeployParameters().withSkipValidationsForMachines(Arrays.asList("bmmName1")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_GetByResourceGroup + +```java +/** Samples for Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json + */ + /** + * Sample code: Get cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_List + +```java +/** Samples for Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json + */ + /** + * Sample code: List clusters for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClustersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_ListByResourceGroup + +```java +/** Samples for Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json + */ + /** + * Sample code: List clusters for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClustersForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Update + +```java +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; +import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_Location.json + */ + /** + * Sample code: Patch cluster location. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterLocation(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withClusterLocation("Foo Street, 3rd Floor, row 9") + .apply(); + } + + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + */ + /** + * Sample code: Patch cluster AggregatorOrSingleRackDefinition. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterAggregatorOrSingleRackDefinition( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAggregatorOrSingleRackDefinition( + new RackDefinition() + .withBareMetalMachineConfigurationData( + Arrays + .asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("newSerialNumber") + .withRackSkuId( + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData( + Arrays + .asList( + new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) + .withComputeDeploymentThreshold( + new ValidationThreshold() + .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + .withType(ValidationThresholdType.PERCENT_SUCCESS) + .withValue(90L)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Clusters_UpdateVersion + +```java +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; + +/** Samples for Clusters UpdateVersion. */ +public final class ClustersUpdateVersionSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json + */ + /** + * Sample code: Update cluster version. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void updateClusterVersion(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .updateVersion( + "resourceGroupName", + "clusterName", + new ClusterUpdateVersionParameters().withTargetClusterVersion("2.0"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Consoles_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Consoles CreateOrUpdate. */ +public final class ConsolesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json + */ + /** + * Sample code: Create or update virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateVirtualMachineConsole( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .define("default") + .withRegion("location") + .withExistingVirtualMachine("resourceGroupName", "virtualMachineName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) + .withEnabled(ConsoleEnabled.TRUE) + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withExpiration(OffsetDateTime.parse("2022-06-01T01:27:03.008Z")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Consoles_Delete + +```java +/** Samples for Consoles Delete. */ +public final class ConsolesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json + */ + /** + * Sample code: Delete virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .delete("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Consoles_Get + +```java +/** Samples for Consoles Get. */ +public final class ConsolesGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json + */ + /** + * Sample code: Get virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Consoles_ListByResourceGroup + +```java +/** Samples for Consoles ListByResourceGroup. */ +public final class ConsolesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json + */ + /** + * Sample code: List virtual machine consoles for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVirtualMachineConsolesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .listByResourceGroup("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### Consoles_Update + +```java +import com.azure.resourcemanager.networkcloud.models.Console; +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Consoles Update. */ +public final class ConsolesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json + */ + /** + * Sample code: Patch virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Console resource = + manager + .consoles() + .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withEnabled(ConsoleEnabled.TRUE) + .withExpiration(OffsetDateTime.parse("2022-06-01T01:27:03.008Z")) + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DefaultCniNetworks_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.BgpPeer; +import com.azure.resourcemanager.networkcloud.models.CniBgpConfiguration; +import com.azure.resourcemanager.networkcloud.models.CommunityAdvertisement; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DefaultCniNetworks CreateOrUpdate. */ +public final class DefaultCniNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json + */ + /** + * Sample code: Create or update default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateDefaultCNINetwork( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .defaultCniNetworks() + .define("defaultCniNetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withL3IsolationDomainId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName") + .withVlan(12L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withCniBgpConfiguration( + new CniBgpConfiguration() + .withBgpPeers(Arrays.asList(new BgpPeer().withAsNumber(64497L).withPeerIp("203.0.113.254"))) + .withCommunityAdvertisements( + Arrays + .asList( + new CommunityAdvertisement() + .withCommunities(Arrays.asList("64512:100")) + .withSubnetPrefix("192.0.2.0/27"))) + .withServiceExternalPrefixes(Arrays.asList("192.0.2.0/28")) + .withServiceLoadBalancerPrefixes(Arrays.asList("192.0.2.16/28"))) + .withIpAllocationType(IpAllocationType.DUAL_STACK) + .withIpv4ConnectedPrefix("203.0.113.0/24") + .withIpv6ConnectedPrefix("2001:db8:0:3::/64") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DefaultCniNetworks_Delete + +```java +/** Samples for DefaultCniNetworks Delete. */ +public final class DefaultCniNetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json + */ + /** + * Sample code: Delete default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteDefaultCNINetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .defaultCniNetworks() + .delete("resourceGroupName", "defaultCniNetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### DefaultCniNetworks_GetByResourceGroup + +```java +/** Samples for DefaultCniNetworks GetByResourceGroup. */ +public final class DefaultCniNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json + */ + /** + * Sample code: Get default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getDefaultCNINetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .defaultCniNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "defaultCniNetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### DefaultCniNetworks_List + +```java +/** Samples for DefaultCniNetworks List. */ +public final class DefaultCniNetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json + */ + /** + * Sample code: List default CNI networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listDefaultCNINetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.defaultCniNetworks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DefaultCniNetworks_ListByResourceGroup + +```java +/** Samples for DefaultCniNetworks ListByResourceGroup. */ +public final class DefaultCniNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json + */ + /** + * Sample code: List default CNI networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listDefaultCNINetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.defaultCniNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### DefaultCniNetworks_Update + +```java +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DefaultCniNetworks Update. */ +public final class DefaultCniNetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json + */ + /** + * Sample code: Patch default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchDefaultCNINetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + DefaultCniNetwork resource = + manager + .defaultCniNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "defaultCniNetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HybridAksClusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for HybridAksClusters CreateOrUpdate. */ +public final class HybridAksClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json + */ + /** + * Sample code: Create or update Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .define("hybridAksClusterName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAssociatedNetworkIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")) + .withControlPlaneCount(4L) + .withHybridAksProvisionedClusterId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName") + .withWorkerCount(8L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HybridAksClusters_Delete + +```java +/** Samples for HybridAksClusters Delete. */ +public final class HybridAksClustersDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json + */ + /** + * Sample code: Delete Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .delete("resourceGroupName", "hybridAksClusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### HybridAksClusters_GetByResourceGroup + +```java +/** Samples for HybridAksClusters GetByResourceGroup. */ +public final class HybridAksClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json + */ + /** + * Sample code: Get Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .getByResourceGroupWithResponse( + "resourceGroupName", "hybridAksClusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### HybridAksClusters_List + +```java +/** Samples for HybridAksClusters List. */ +public final class HybridAksClustersListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json + */ + /** + * Sample code: List Hybrid AKS provisioned clusters data for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listHybridAKSProvisionedClustersDataForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.hybridAksClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### HybridAksClusters_ListByResourceGroup + +```java +/** Samples for HybridAksClusters ListByResourceGroup. */ +public final class HybridAksClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json + */ + /** + * Sample code: List Hybrid AKS provisioned clusters data for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listHybridAKSProvisionedClustersDataForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.hybridAksClusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### HybridAksClusters_RestartNode + +```java +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterRestartNodeParameters; + +/** Samples for HybridAksClusters RestartNode. */ +public final class HybridAksClustersRestartNodeSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json + */ + /** + * Sample code: Restart a Hybrid AKS cluster node. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void restartAHybridAKSClusterNode( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .restartNode( + "resourceGroupName", + "hybridAksClusterName", + new HybridAksClusterRestartNodeParameters().withNodeName("nodeName"), + com.azure.core.util.Context.NONE); + } +} +``` + +### HybridAksClusters_Update + +```java +import com.azure.resourcemanager.networkcloud.models.HybridAksCluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for HybridAksClusters Update. */ +public final class HybridAksClustersUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json + */ + /** + * Sample code: Patch Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + HybridAksCluster resource = + manager + .hybridAksClusters() + .getByResourceGroupWithResponse( + "resourceGroupName", "hybridAksClusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### L2Networks_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L2Networks CreateOrUpdate. */ +public final class L2NetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json + */ + /** + * Sample code: Create or update L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l2Networks() + .define("l2NetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withL2IsolationDomainId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withHybridAksPluginType(HybridAksPluginType.DPDK) + .withInterfaceName("eth0") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### L2Networks_Delete + +```java +/** Samples for L2Networks Delete. */ +public final class L2NetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json + */ + /** + * Sample code: Delete L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l2Networks().delete("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### L2Networks_GetByResourceGroup + +```java +/** Samples for L2Networks GetByResourceGroup. */ +public final class L2NetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json + */ + /** + * Sample code: Get L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l2Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### L2Networks_List + +```java +/** Samples for L2Networks List. */ +public final class L2NetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json + */ + /** + * Sample code: List L2 networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL2NetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l2Networks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### L2Networks_ListByResourceGroup + +```java +/** Samples for L2Networks ListByResourceGroup. */ +public final class L2NetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json + */ + /** + * Sample code: List L2 networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL2NetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l2Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### L2Networks_Update + +```java +import com.azure.resourcemanager.networkcloud.models.L2Network; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L2Networks Update. */ +public final class L2NetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json + */ + /** + * Sample code: Patch L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + L2Network resource = + manager + .l2Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### L3Networks_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L3Networks CreateOrUpdate. */ +public final class L3NetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json + */ + /** + * Sample code: Create or update L3 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l3Networks() + .define("l3NetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withL3IsolationDomainId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName") + .withVlan(12L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withHybridAksIpamEnabled(HybridAksIpamEnabled.TRUE) + .withHybridAksPluginType(HybridAksPluginType.DPDK) + .withInterfaceName("eth0") + .withIpAllocationType(IpAllocationType.DUAL_STACK) + .withIpv4ConnectedPrefix("198.51.100.0/24") + .withIpv6ConnectedPrefix("2001:db8::/64") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### L3Networks_Delete + +```java +/** Samples for L3Networks Delete. */ +public final class L3NetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json + */ + /** + * Sample code: Delete L3 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l3Networks().delete("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### L3Networks_GetByResourceGroup + +```java +/** Samples for L3Networks GetByResourceGroup. */ +public final class L3NetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json + */ + /** + * Sample code: Get L3network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getL3network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l3Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### L3Networks_List + +```java +/** Samples for L3Networks List. */ +public final class L3NetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json + */ + /** + * Sample code: List L3 networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL3NetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l3Networks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### L3Networks_ListByResourceGroup + +```java +/** Samples for L3Networks ListByResourceGroup. */ +public final class L3NetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json + */ + /** + * Sample code: List L3 networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL3NetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l3Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### L3Networks_Update + +```java +import com.azure.resourcemanager.networkcloud.models.L3Network; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L3Networks Update. */ +public final class L3NetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json + */ + /** + * Sample code: Patch L3 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + L3Network resource = + manager + .l3Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### MetricsConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MetricsConfigurations CreateOrUpdate. */ +public final class MetricsConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json + */ + /** + * Sample code: Update metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void updateMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .define("default") + .withRegion("location") + .withExistingCluster("resourceGroupName", "clusterName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withCollectionInterval(15L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withEnabledMetrics(Arrays.asList("metric1", "metric2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### MetricsConfigurations_Delete + +```java +/** Samples for MetricsConfigurations Delete. */ +public final class MetricsConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json + */ + /** + * Sample code: Delete metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .delete("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### MetricsConfigurations_Get + +```java +/** Samples for MetricsConfigurations Get. */ +public final class MetricsConfigurationsGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json + */ + /** + * Sample code: Get metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### MetricsConfigurations_ListByResourceGroup + +```java +/** Samples for MetricsConfigurations ListByResourceGroup. */ +public final class MetricsConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json + */ + /** + * Sample code: List metrics configurations of cluster for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listMetricsConfigurationsOfClusterForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .listByResourceGroup("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### MetricsConfigurations_Update + +```java +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MetricsConfigurations Update. */ +public final class MetricsConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json + */ + /** + * Sample code: Patch metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + ClusterMetricsConfiguration resource = + manager + .metricsConfigurations() + .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withCollectionInterval(15L) + .withEnabledMetrics(Arrays.asList("metric1", "metric2")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json + */ + /** + * Sample code: List resource provider operations. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listResourceProviderOperations( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RackSkus_Get + +```java +/** Samples for RackSkus Get. */ +public final class RackSkusGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json + */ + /** + * Sample code: Get rack SKU resource. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getRackSKUResource(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.rackSkus().getWithResponse("rackSkuName", com.azure.core.util.Context.NONE); + } +} +``` + +### RackSkus_List + +```java +/** Samples for RackSkus List. */ +public final class RackSkusListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json + */ + /** + * Sample code: List rack SKUs for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listRackSKUsForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.rackSkus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Racks_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Racks CreateOrUpdate. */ +public final class RacksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json + */ + /** + * Sample code: Create or update rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .racks() + .define("rackName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAvailabilityZone("1") + .withRackLocation("Rack 28") + .withRackSerialNumber("RACK_SERIAL_NUMBER") + .withRackSkuId("RACK-TYPE-1") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Racks_Delete + +```java +/** Samples for Racks Delete. */ +public final class RacksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json + */ + /** + * Sample code: Delete rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.racks().delete("resourceGroupName", "rackName", com.azure.core.util.Context.NONE); + } +} +``` + +### Racks_GetByResourceGroup + +```java +/** Samples for Racks GetByResourceGroup. */ +public final class RacksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json + */ + /** + * Sample code: Get rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .racks() + .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE); + } +} +``` + +### Racks_List + +```java +/** Samples for Racks List. */ +public final class RacksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json + */ + /** + * Sample code: List racks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listRacksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.racks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Racks_ListByResourceGroup + +```java +/** Samples for Racks ListByResourceGroup. */ +public final class RacksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json + */ + /** + * Sample code: List racks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listRacksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.racks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### Racks_Update + +```java +import com.azure.resourcemanager.networkcloud.models.Rack; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Racks Update. */ +public final class RacksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json + */ + /** + * Sample code: Patch rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Rack resource = + manager + .racks() + .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withRackLocation("Rack 2B") + .withRackSerialNumber("RACK_SERIAL_NUMBER") + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageAppliances_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAppliances CreateOrUpdate. */ +public final class StorageAppliancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json + */ + /** + * Sample code: Create or update storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .define("storageApplianceName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAdministratorCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("adminUser")) + .withRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceSkuId("684E-3B16-399E") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageAppliances_Delete + +```java +/** Samples for StorageAppliances Delete. */ +public final class StorageAppliancesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json + */ + /** + * Sample code: Delete storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .delete("resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_DisableRemoteVendorManagement + +```java +/** Samples for StorageAppliances DisableRemoteVendorManagement. */ +public final class StorageAppliancesDisableRemoteVendorManagementSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json + */ + /** + * Sample code: Turn off remote vendor management for storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void turnOffRemoteVendorManagementForStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .disableRemoteVendorManagement( + "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_EnableRemoteVendorManagement + +```java +import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; +import java.util.Arrays; + +/** Samples for StorageAppliances EnableRemoteVendorManagement. */ +public final class StorageAppliancesEnableRemoteVendorManagementSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json + */ + /** + * Sample code: Turn on remote vendor management for storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void turnOnRemoteVendorManagementForStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .enableRemoteVendorManagement( + "resourceGroupName", + "storageApplianceName", + new StorageApplianceEnableRemoteVendorManagementParameters() + .withSupportEndpoints(Arrays.asList("10.0.0.0/24")), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_GetByResourceGroup + +```java +/** Samples for StorageAppliances GetByResourceGroup. */ +public final class StorageAppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json + */ + /** + * Sample code: Get storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .getByResourceGroupWithResponse( + "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_List + +```java +/** Samples for StorageAppliances List. */ +public final class StorageAppliancesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json + */ + /** + * Sample code: List storage appliances for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listStorageAppliancesForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.storageAppliances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_ListByResourceGroup + +```java +/** Samples for StorageAppliances ListByResourceGroup. */ +public final class StorageAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json + */ + /** + * Sample code: List storage appliances for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listStorageAppliancesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.storageAppliances().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_RunReadCommands + +```java +import com.azure.resourcemanager.networkcloud.models.StorageApplianceCommandSpecification; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters; +import java.util.Arrays; + +/** Samples for StorageAppliances RunReadCommands. */ +public final class StorageAppliancesRunReadCommandsSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json + */ + /** + * Sample code: Run and retrieve output from read only commands on storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .runReadCommands( + "resourceGroupName", + "storageApplianceName", + new StorageApplianceRunReadCommandsParameters() + .withCommands(Arrays.asList(new StorageApplianceCommandSpecification().withCommand("AlertList"))) + .withLimitTimeSeconds(60L), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAppliances_Update + +```java +import com.azure.resourcemanager.networkcloud.models.StorageAppliance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAppliances Update. */ +public final class StorageAppliancesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json + */ + /** + * Sample code: Patch storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + StorageAppliance resource = + manager + .storageAppliances() + .getByResourceGroupWithResponse( + "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).withSerialNumber("BM1219XXX").apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageAppliances_ValidateHardware + +```java +import com.azure.resourcemanager.networkcloud.models.StorageApplianceHardwareValidationCategory; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceValidateHardwareParameters; + +/** Samples for StorageAppliances ValidateHardware. */ +public final class StorageAppliancesValidateHardwareSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json + */ + /** + * Sample code: Validate the storage appliance hardware. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void validateTheStorageApplianceHardware( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .validateHardware( + "resourceGroupName", + "storageApplianceName", + new StorageApplianceValidateHardwareParameters() + .withValidationCategory(StorageApplianceHardwareValidationCategory.BASIC_VALIDATION), + com.azure.core.util.Context.NONE); + } +} +``` + +### TrunkedNetworks_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TrunkedNetworks CreateOrUpdate. */ +public final class TrunkedNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json + */ + /** + * Sample code: Create or update trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateTrunkedNetwork( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .trunkedNetworks() + .define("trunkedNetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withIsolationDomainIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")) + .withVlans(Arrays.asList(12L, 14L)) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withHybridAksPluginType(HybridAksPluginType.DPDK) + .withInterfaceName("eth0") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### TrunkedNetworks_Delete + +```java +/** Samples for TrunkedNetworks Delete. */ +public final class TrunkedNetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json + */ + /** + * Sample code: Delete trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks().delete("resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### TrunkedNetworks_GetByResourceGroup + +```java +/** Samples for TrunkedNetworks GetByResourceGroup. */ +public final class TrunkedNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json + */ + /** + * Sample code: Get Trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .trunkedNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE); + } +} +``` + +### TrunkedNetworks_List + +```java +/** Samples for TrunkedNetworks List. */ +public final class TrunkedNetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json + */ + /** + * Sample code: List trunked networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listTrunkedNetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### TrunkedNetworks_ListByResourceGroup + +```java +/** Samples for TrunkedNetworks ListByResourceGroup. */ +public final class TrunkedNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json + */ + /** + * Sample code: List Trunked networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listTrunkedNetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### TrunkedNetworks_Update + +```java +import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TrunkedNetworks Update. */ +public final class TrunkedNetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json + */ + /** + * Sample code: Patch trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + TrunkedNetwork resource = + manager + .trunkedNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachines_AttachVolume + +```java +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; + +/** Samples for VirtualMachines AttachVolume. */ +public final class VirtualMachinesAttachVolumeSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json + */ + /** + * Sample code: Attach volume to virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void attachVolumeToVirtualMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .attachVolume( + "resourceGroupName", + "virtualMachineName", + new VirtualMachineVolumeParameters() + .withVolumeId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.DefaultGateway; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; +import com.azure.resourcemanager.networkcloud.models.OsDisk; +import com.azure.resourcemanager.networkcloud.models.OsDiskCreateOption; +import com.azure.resourcemanager.networkcloud.models.OsDiskDeleteOption; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.azure.resourcemanager.networkcloud.models.StorageProfile; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineBootMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDeviceModelType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineIpAllocationMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHint; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHintPodAffinityScope; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHintType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineSchedulingExecution; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json + */ + /** + * Sample code: Create or update virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateVirtualMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .define("virtualMachineName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAdminUsername("username") + .withCloudServicesNetworkAttachment( + new NetworkAttachment() + .withAttachedNetworkId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC)) + .withCpuCores(2L) + .withMemorySizeGB(8L) + .withStorageProfile( + new StorageProfile() + .withOsDisk( + new OsDisk() + .withCreateOption(OsDiskCreateOption.EPHEMERAL) + .withDeleteOption(OsDiskDeleteOption.DELETE) + .withDiskSizeGB(120L)) + .withVolumeAttachments( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"))) + .withVmImage("myacr.azurecr.io/foobar:latest") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withBootMethod(VirtualMachineBootMethod.UEFI) + .withNetworkAttachments( + Arrays + .asList( + new NetworkAttachment() + .withAttachedNetworkId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDefaultGateway(DefaultGateway.TRUE) + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC) + .withIpv4Address("198.51.100.1") + .withIpv6Address("2001:0db8:0000:0000:0000:0000:0000:0000") + .withNetworkAttachmentName("netAttachName01"))) + .withNetworkData("bmV0d29ya0RhdGVTYW1wbGU=") + .withPlacementHints( + Arrays + .asList( + new VirtualMachinePlacementHint() + .withHintType(VirtualMachinePlacementHintType.AFFINITY) + .withResourceId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withSchedulingExecution(VirtualMachineSchedulingExecution.HARD) + .withScope(VirtualMachinePlacementHintPodAffinityScope.fromString("")))) + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))) + .withUserData("dXNlckRhdGVTYW1wbGU=") + .withVmDeviceModel(VirtualMachineDeviceModelType.T2) + .withVmImageRepositoryCredentials( + new ImageRepositoryCredentials() + .withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualMachines_Delete + +```java +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json + */ + /** + * Sample code: Delete virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().delete("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_DetachVolume + +```java +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; + +/** Samples for VirtualMachines DetachVolume. */ +public final class VirtualMachinesDetachVolumeSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json + */ + /** + * Sample code: Detach volume from virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void detachVolumeFromVirtualMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .detachVolume( + "resourceGroupName", + "virtualMachineName", + new VirtualMachineVolumeParameters() + .withVolumeId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_GetByResourceGroup + +```java +/** Samples for VirtualMachines GetByResourceGroup. */ +public final class VirtualMachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json + */ + /** + * Sample code: Get virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_List + +```java +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json + */ + /** + * Sample code: List virtual machines for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVirtualMachinesForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_ListByResourceGroup + +```java +/** Samples for VirtualMachines ListByResourceGroup. */ +public final class VirtualMachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json + */ + /** + * Sample code: List virtual machines for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVirtualMachinesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_PowerOff + +```java +import com.azure.resourcemanager.networkcloud.models.SkipShutdown; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; + +/** Samples for VirtualMachines PowerOff. */ +public final class VirtualMachinesPowerOffSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json + */ + /** + * Sample code: Power off virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void powerOffVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .powerOff( + "resourceGroupName", + "virtualMachineName", + new VirtualMachinePowerOffParameters().withSkipShutdown(SkipShutdown.TRUE), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Reimage + +```java +/** Samples for VirtualMachines Reimage. */ +public final class VirtualMachinesReimageSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json + */ + /** + * Sample code: Reimage virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void reimageVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().reimage("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Restart + +```java +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json + */ + /** + * Sample code: Restart virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void restartVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().restart("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Start + +```java +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json + */ + /** + * Sample code: Start virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().start("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualMachines_Update + +```java +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.VirtualMachine; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json + */ + /** + * Sample code: Patch virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + VirtualMachine resource = + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withVmImageRepositoryCredentials( + new ImageRepositoryCredentials() + .withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Volumes_CreateOrUpdate + +```java +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes CreateOrUpdate. */ +public final class VolumesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json + */ + /** + * Sample code: Create or update volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .volumes() + .define("volumeName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withSizeMiB(10000L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Volumes_Delete + +```java +/** Samples for Volumes Delete. */ +public final class VolumesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json + */ + /** + * Sample code: Delete volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.volumes().delete("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE); + } +} +``` + +### Volumes_GetByResourceGroup + +```java +/** Samples for Volumes GetByResourceGroup. */ +public final class VolumesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json + */ + /** + * Sample code: Get volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .volumes() + .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE); + } +} +``` + +### Volumes_List + +```java +/** Samples for Volumes List. */ +public final class VolumesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json + */ + /** + * Sample code: List volume for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVolumeForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.volumes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Volumes_ListByResourceGroup + +```java +/** Samples for Volumes ListByResourceGroup. */ +public final class VolumesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json + */ + /** + * Sample code: List volumes for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVolumesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.volumes().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### Volumes_Update + +```java +import com.azure.resourcemanager.networkcloud.models.Volume; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes Update. */ +public final class VolumesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json + */ + /** + * Sample code: Patch volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Volume resource = + manager + .volumes() + .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml b/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml new file mode 100644 index 000000000000..cc38596985e4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-networkcloud + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for NetworkCloud Management + This package contains Microsoft Azure SDK for NetworkCloud Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Network Cloud APIs provide management of the on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. Package tag package-2022-12-12-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + + + + com.azure + azure-core + 1.39.0 + + + com.azure + azure-core-management + 1.11.1 + + + diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java new file mode 100644 index 000000000000..7819583bccbf --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/NetworkCloudManager.java @@ -0,0 +1,574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.NetworkCloud; +import com.azure.resourcemanager.networkcloud.implementation.BareMetalMachineKeySetsImpl; +import com.azure.resourcemanager.networkcloud.implementation.BareMetalMachinesImpl; +import com.azure.resourcemanager.networkcloud.implementation.BmcKeySetsImpl; +import com.azure.resourcemanager.networkcloud.implementation.CloudServicesNetworksImpl; +import com.azure.resourcemanager.networkcloud.implementation.ClusterManagersImpl; +import com.azure.resourcemanager.networkcloud.implementation.ClustersImpl; +import com.azure.resourcemanager.networkcloud.implementation.ConsolesImpl; +import com.azure.resourcemanager.networkcloud.implementation.DefaultCniNetworksImpl; +import com.azure.resourcemanager.networkcloud.implementation.HybridAksClustersImpl; +import com.azure.resourcemanager.networkcloud.implementation.L2NetworksImpl; +import com.azure.resourcemanager.networkcloud.implementation.L3NetworksImpl; +import com.azure.resourcemanager.networkcloud.implementation.MetricsConfigurationsImpl; +import com.azure.resourcemanager.networkcloud.implementation.NetworkCloudBuilder; +import com.azure.resourcemanager.networkcloud.implementation.OperationsImpl; +import com.azure.resourcemanager.networkcloud.implementation.RackSkusImpl; +import com.azure.resourcemanager.networkcloud.implementation.RacksImpl; +import com.azure.resourcemanager.networkcloud.implementation.StorageAppliancesImpl; +import com.azure.resourcemanager.networkcloud.implementation.TrunkedNetworksImpl; +import com.azure.resourcemanager.networkcloud.implementation.VirtualMachinesImpl; +import com.azure.resourcemanager.networkcloud.implementation.VolumesImpl; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySets; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachines; +import com.azure.resourcemanager.networkcloud.models.BmcKeySets; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworks; +import com.azure.resourcemanager.networkcloud.models.ClusterManagers; +import com.azure.resourcemanager.networkcloud.models.Clusters; +import com.azure.resourcemanager.networkcloud.models.Consoles; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworks; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusters; +import com.azure.resourcemanager.networkcloud.models.L2Networks; +import com.azure.resourcemanager.networkcloud.models.L3Networks; +import com.azure.resourcemanager.networkcloud.models.MetricsConfigurations; +import com.azure.resourcemanager.networkcloud.models.Operations; +import com.azure.resourcemanager.networkcloud.models.RackSkus; +import com.azure.resourcemanager.networkcloud.models.Racks; +import com.azure.resourcemanager.networkcloud.models.StorageAppliances; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworks; +import com.azure.resourcemanager.networkcloud.models.VirtualMachines; +import com.azure.resourcemanager.networkcloud.models.Volumes; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to NetworkCloudManager. The Network Cloud APIs provide management of the on-premises clusters and their + * resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + */ +public final class NetworkCloudManager { + private Operations operations; + + private BareMetalMachines bareMetalMachines; + + private CloudServicesNetworks cloudServicesNetworks; + + private ClusterManagers clusterManagers; + + private Clusters clusters; + + private DefaultCniNetworks defaultCniNetworks; + + private HybridAksClusters hybridAksClusters; + + private L2Networks l2Networks; + + private L3Networks l3Networks; + + private RackSkus rackSkus; + + private Racks racks; + + private StorageAppliances storageAppliances; + + private TrunkedNetworks trunkedNetworks; + + private VirtualMachines virtualMachines; + + private Volumes volumes; + + private BareMetalMachineKeySets bareMetalMachineKeySets; + + private BmcKeySets bmcKeySets; + + private MetricsConfigurations metricsConfigurations; + + private Consoles consoles; + + private final NetworkCloud clientObject; + + private NetworkCloudManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new NetworkCloudBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of NetworkCloud service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the NetworkCloud service API instance. + */ + public static NetworkCloudManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of NetworkCloud service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the NetworkCloud service API instance. + */ + public static NetworkCloudManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new NetworkCloudManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create NetworkCloudManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new NetworkCloudManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of NetworkCloud service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the NetworkCloud service API instance. + */ + public NetworkCloudManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.networkcloud") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new NetworkCloudManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * 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); + } + return operations; + } + + /** + * Gets the resource collection API of BareMetalMachines. It manages BareMetalMachine. + * + * @return Resource collection API of BareMetalMachines. + */ + public BareMetalMachines bareMetalMachines() { + if (this.bareMetalMachines == null) { + this.bareMetalMachines = new BareMetalMachinesImpl(clientObject.getBareMetalMachines(), this); + } + return bareMetalMachines; + } + + /** + * Gets the resource collection API of CloudServicesNetworks. It manages CloudServicesNetwork. + * + * @return Resource collection API of CloudServicesNetworks. + */ + public CloudServicesNetworks cloudServicesNetworks() { + if (this.cloudServicesNetworks == null) { + this.cloudServicesNetworks = new CloudServicesNetworksImpl(clientObject.getCloudServicesNetworks(), this); + } + return cloudServicesNetworks; + } + + /** + * Gets the resource collection API of ClusterManagers. It manages ClusterManager. + * + * @return Resource collection API of ClusterManagers. + */ + public ClusterManagers clusterManagers() { + if (this.clusterManagers == null) { + this.clusterManagers = new ClusterManagersImpl(clientObject.getClusterManagers(), this); + } + return clusterManagers; + } + + /** + * Gets the resource collection API of Clusters. It manages Cluster. + * + * @return Resource collection API of Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** + * Gets the resource collection API of DefaultCniNetworks. It manages DefaultCniNetwork. + * + * @return Resource collection API of DefaultCniNetworks. + */ + public DefaultCniNetworks defaultCniNetworks() { + if (this.defaultCniNetworks == null) { + this.defaultCniNetworks = new DefaultCniNetworksImpl(clientObject.getDefaultCniNetworks(), this); + } + return defaultCniNetworks; + } + + /** + * Gets the resource collection API of HybridAksClusters. It manages HybridAksCluster. + * + * @return Resource collection API of HybridAksClusters. + */ + public HybridAksClusters hybridAksClusters() { + if (this.hybridAksClusters == null) { + this.hybridAksClusters = new HybridAksClustersImpl(clientObject.getHybridAksClusters(), this); + } + return hybridAksClusters; + } + + /** + * Gets the resource collection API of L2Networks. It manages L2Network. + * + * @return Resource collection API of L2Networks. + */ + public L2Networks l2Networks() { + if (this.l2Networks == null) { + this.l2Networks = new L2NetworksImpl(clientObject.getL2Networks(), this); + } + return l2Networks; + } + + /** + * Gets the resource collection API of L3Networks. It manages L3Network. + * + * @return Resource collection API of L3Networks. + */ + public L3Networks l3Networks() { + if (this.l3Networks == null) { + this.l3Networks = new L3NetworksImpl(clientObject.getL3Networks(), this); + } + return l3Networks; + } + + /** + * Gets the resource collection API of RackSkus. + * + * @return Resource collection API of RackSkus. + */ + public RackSkus rackSkus() { + if (this.rackSkus == null) { + this.rackSkus = new RackSkusImpl(clientObject.getRackSkus(), this); + } + return rackSkus; + } + + /** + * Gets the resource collection API of Racks. It manages Rack. + * + * @return Resource collection API of Racks. + */ + public Racks racks() { + if (this.racks == null) { + this.racks = new RacksImpl(clientObject.getRacks(), this); + } + return racks; + } + + /** + * Gets the resource collection API of StorageAppliances. It manages StorageAppliance. + * + * @return Resource collection API of StorageAppliances. + */ + public StorageAppliances storageAppliances() { + if (this.storageAppliances == null) { + this.storageAppliances = new StorageAppliancesImpl(clientObject.getStorageAppliances(), this); + } + return storageAppliances; + } + + /** + * Gets the resource collection API of TrunkedNetworks. It manages TrunkedNetwork. + * + * @return Resource collection API of TrunkedNetworks. + */ + public TrunkedNetworks trunkedNetworks() { + if (this.trunkedNetworks == null) { + this.trunkedNetworks = new TrunkedNetworksImpl(clientObject.getTrunkedNetworks(), this); + } + return trunkedNetworks; + } + + /** + * Gets the resource collection API of VirtualMachines. It manages VirtualMachine. + * + * @return Resource collection API of VirtualMachines. + */ + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + } + return virtualMachines; + } + + /** + * Gets the resource collection API of Volumes. It manages Volume. + * + * @return Resource collection API of Volumes. + */ + public Volumes volumes() { + if (this.volumes == null) { + this.volumes = new VolumesImpl(clientObject.getVolumes(), this); + } + return volumes; + } + + /** + * Gets the resource collection API of BareMetalMachineKeySets. It manages BareMetalMachineKeySet. + * + * @return Resource collection API of BareMetalMachineKeySets. + */ + public BareMetalMachineKeySets bareMetalMachineKeySets() { + if (this.bareMetalMachineKeySets == null) { + this.bareMetalMachineKeySets = + new BareMetalMachineKeySetsImpl(clientObject.getBareMetalMachineKeySets(), this); + } + return bareMetalMachineKeySets; + } + + /** + * Gets the resource collection API of BmcKeySets. It manages BmcKeySet. + * + * @return Resource collection API of BmcKeySets. + */ + public BmcKeySets bmcKeySets() { + if (this.bmcKeySets == null) { + this.bmcKeySets = new BmcKeySetsImpl(clientObject.getBmcKeySets(), this); + } + return bmcKeySets; + } + + /** + * Gets the resource collection API of MetricsConfigurations. It manages ClusterMetricsConfiguration. + * + * @return Resource collection API of MetricsConfigurations. + */ + public MetricsConfigurations metricsConfigurations() { + if (this.metricsConfigurations == null) { + this.metricsConfigurations = new MetricsConfigurationsImpl(clientObject.getMetricsConfigurations(), this); + } + return metricsConfigurations; + } + + /** + * Gets the resource collection API of Consoles. It manages Console. + * + * @return Resource collection API of Consoles. + */ + public Consoles consoles() { + if (this.consoles == null) { + this.consoles = new ConsolesImpl(clientObject.getConsoles(), this); + } + return consoles; + } + + /** + * @return Wrapped service client NetworkCloud providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public NetworkCloud serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java new file mode 100644 index 000000000000..4944a15f775f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachineKeySetsClient.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPatchParameters; + +/** An instance of this class provides access to all the operations defined in BareMetalMachineKeySetsClient. */ +public interface BareMetalMachineKeySetsClient { + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName); + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context); + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineKeySetInner get(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineKeySetInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters); + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineKeySetInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + Context context); + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineKeySetInner createOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters); + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineKeySetInner createOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + Context context); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName, Context context); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context); + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineKeySetInner> beginUpdate( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineKeySetInner> beginUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + Context context); + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineKeySetInner update(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineKeySetInner update( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java new file mode 100644 index 000000000000..a7f41c5bf133 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BareMetalMachinesClient.java @@ -0,0 +1,1124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.BareMetalMachineInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePatchParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineValidateHardwareParameters; + +/** An instance of this class provides access to all the operations defined in BareMetalMachinesClient. */ +public interface BareMetalMachinesClient { + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 a list of bare metal machines in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 a list of bare metal machines in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of bare metal machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of bare metal machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineInner getByResourceGroup(String resourceGroupName, String bareMetalMachineName); + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineInner> beginCreateOrUpdate( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters); + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineInner> beginCreateOrUpdate( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + Context context); + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineInner createOrUpdate( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters); + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineInner createOrUpdate( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + Context context); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName, Context context); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 delete(String resourceGroupName, String bareMetalMachineName); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 delete(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineInner> beginUpdate( + String resourceGroupName, String bareMetalMachineName); + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BareMetalMachineInner> beginUpdate( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + Context context); + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineInner update(String resourceGroupName, String bareMetalMachineName); + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BareMetalMachineInner update( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + Context context); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginCordon(String resourceGroupName, String bareMetalMachineName); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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> beginCordon( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 cordon(String resourceGroupName, String bareMetalMachineName); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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 cordon( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginPowerOff(String resourceGroupName, String bareMetalMachineName); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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> beginPowerOff( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 powerOff(String resourceGroupName, String bareMetalMachineName); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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 powerOff( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReimage(String resourceGroupName, String bareMetalMachineName); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReimage( + String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimage(String resourceGroupName, String bareMetalMachineName); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimage(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReplace(String resourceGroupName, String bareMetalMachineName); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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> beginReplace( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 replace(String resourceGroupName, String bareMetalMachineName); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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 replace( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginRestart(String resourceGroupName, String bareMetalMachineName); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginRestart( + String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restart(String resourceGroupName, String bareMetalMachineName); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restart(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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> beginRunCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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> beginRunCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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> beginRunDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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> beginRunDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginStart(String resourceGroupName, String bareMetalMachineName); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginStart( + String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 start(String resourceGroupName, String bareMetalMachineName); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 start(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginUncordon(String resourceGroupName, String bareMetalMachineName); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginUncordon( + String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordon(String resourceGroupName, String bareMetalMachineName); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordon(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java new file mode 100644 index 000000000000..68b04d296b9d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/BmcKeySetsClient.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPatchParameters; + +/** An instance of this class provides access to all the operations defined in BmcKeySetsClient. */ +public interface BmcKeySetsClient { + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName); + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String bmcKeySetName, Context context); + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BmcKeySetInner get(String resourceGroupName, String clusterName, String bmcKeySetName); + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BmcKeySetInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters); + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BmcKeySetInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + Context context); + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BmcKeySetInner createOrUpdate( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters); + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BmcKeySetInner createOrUpdate( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + Context context); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName, Context context); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 delete(String resourceGroupName, String clusterName, String bmcKeySetName); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context); + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BmcKeySetInner> beginUpdate( + String resourceGroupName, String clusterName, String bmcKeySetName); + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BmcKeySetInner> beginUpdate( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + Context context); + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BmcKeySetInner update(String resourceGroupName, String clusterName, String bmcKeySetName); + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BmcKeySetInner update( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java new file mode 100644 index 000000000000..8fb0334b616b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/CloudServicesNetworksClient.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkPatchParameters; + +/** An instance of this class provides access to all the operations defined in CloudServicesNetworksClient. */ +public interface CloudServicesNetworksClient { + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 a list of cloud services networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 a list of cloud services networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cloud services networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cloud services networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServicesNetworkName, Context context); + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServicesNetworkInner getByResourceGroup(String resourceGroupName, String cloudServicesNetworkName); + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters); + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + Context context); + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServicesNetworkInner createOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters); + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServicesNetworkInner createOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + Context context); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName, Context context); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 delete(String resourceGroupName, String cloudServicesNetworkName); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 delete(String resourceGroupName, String cloudServicesNetworkName, Context context); + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServicesNetworkInner> beginUpdate( + String resourceGroupName, String cloudServicesNetworkName); + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudServicesNetworkInner> beginUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + Context context); + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServicesNetworkInner update(String resourceGroupName, String cloudServicesNetworkName); + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudServicesNetworkInner update( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java new file mode 100644 index 000000000000..9684d003df06 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClusterManagersClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerPatchParameters; + +/** An instance of this class provides access to all the operations defined in ClusterManagersClient. */ +public interface ClusterManagersClient { + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cluster managers in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cluster managers in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterManagerName, Context context); + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterManagerInner getByResourceGroup(String resourceGroupName, String clusterManagerName); + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more + * on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterManagerInner> beginCreateOrUpdate( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters); + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more + * on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterManagerInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + Context context); + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterManagerInner createOrUpdate( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters); + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterManagerInner createOrUpdate( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + Context context); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName, Context context); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 delete(String resourceGroupName, String clusterManagerName); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 delete(String resourceGroupName, String clusterManagerName, Context context); + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerUpdateParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String clusterManagerName, + ClusterManagerPatchParameters clusterManagerUpdateParameters, + Context context); + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterManagerInner update(String resourceGroupName, String clusterManagerName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java new file mode 100644 index 000000000000..652e7ad40ec9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ClustersClient.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.ClusterInner; +import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public interface ClustersClient { + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of clusters in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of clusters in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner clusterParameters); + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, Context context); + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner clusterParameters); + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, Context context); + + /** + * Delete the cluster. + * + *

Delete the provided 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 the cluster. + * + *

Delete the provided 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 the cluster. + * + *

Delete the provided 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Delete the cluster. + * + *

Delete the provided 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName); + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, Context context); + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName); + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, Context context); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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> beginDeploy(String resourceGroupName, String clusterName); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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> beginDeploy( + String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters, Context context); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deploy(String resourceGroupName, String clusterName); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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 deploy( + String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters, Context context); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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> beginUpdateVersion( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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> beginUpdateVersion( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java new file mode 100644 index 000000000000..ad9a3b7aa69c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/ConsolesClient.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.models.ConsolePatchParameters; + +/** An instance of this class provides access to all the operations defined in ConsolesClient. */ +public interface ConsolesClient { + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 a list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String virtualMachineName); + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 a list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String virtualMachineName, String consoleName, Context context); + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsoleInner get(String resourceGroupName, String virtualMachineName, String consoleName); + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConsoleInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters); + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConsoleInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + Context context); + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsoleInner createOrUpdate( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters); + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsoleInner createOrUpdate( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + Context context); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName, Context context); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 delete(String resourceGroupName, String virtualMachineName, String consoleName); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context); + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConsoleInner> beginUpdate( + String resourceGroupName, String virtualMachineName, String consoleName); + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConsoleInner> beginUpdate( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + Context context); + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsoleInner update(String resourceGroupName, String virtualMachineName, String consoleName); + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConsoleInner update( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/DefaultCniNetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/DefaultCniNetworksClient.java new file mode 100644 index 000000000000..a33cfb8d010d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/DefaultCniNetworksClient.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.DefaultCniNetworkInner; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkPatchParameters; + +/** An instance of this class provides access to all the operations defined in DefaultCniNetworksClient. */ +public interface DefaultCniNetworksClient { + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 a list of default CNI networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 a list of default CNI networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of default CNI networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of default CNI networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String defaultCniNetworkName, Context context); + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultCniNetworkInner getByResourceGroup(String resourceGroupName, String defaultCniNetworkName); + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the + * default CNI (pod) network that is created in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DefaultCniNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters); + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the + * default CNI (pod) network that is created in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DefaultCniNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + Context context); + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultCniNetworkInner createOrUpdate( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters); + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultCniNetworkInner createOrUpdate( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + Context context); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName, Context context); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 delete(String resourceGroupName, String defaultCniNetworkName); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 delete(String resourceGroupName, String defaultCniNetworkName, Context context); + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkUpdateParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters, + Context context); + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DefaultCniNetworkInner update(String resourceGroupName, String defaultCniNetworkName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/HybridAksClustersClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/HybridAksClustersClient.java new file mode 100644 index 000000000000..f28d8b1a69f0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/HybridAksClustersClient.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.HybridAksClusterInner; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterRestartNodeParameters; + +/** An instance of this class provides access to all the operations defined in HybridAksClustersClient. */ +public interface HybridAksClustersClient { + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String hybridAksClusterName, Context context); + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HybridAksClusterInner getByResourceGroup(String resourceGroupName, String hybridAksClusterName); + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the + * Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HybridAksClusterInner> beginCreateOrUpdate( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters); + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the + * Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HybridAksClusterInner> beginCreateOrUpdate( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + Context context); + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HybridAksClusterInner createOrUpdate( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters); + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HybridAksClusterInner createOrUpdate( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + Context context); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName, Context context); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hybridAksClusterName); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String hybridAksClusterName, Context context); + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterUpdateParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterPatchParameters hybridAksClusterUpdateParameters, + Context context); + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HybridAksClusterInner update(String resourceGroupName, String hybridAksClusterName); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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> beginRestartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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> beginRestartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java new file mode 100644 index 000000000000..160edf974c99 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L2NetworksClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.models.L2NetworkPatchParameters; + +/** An instance of this class provides access to all the operations defined in L2NetworksClient. */ +public interface L2NetworksClient { + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String l2NetworkName, Context context); + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2NetworkInner getByResourceGroup(String resourceGroupName, String l2NetworkName); + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation + * domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L2NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters); + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation + * domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L2NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, Context context); + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2NetworkInner createOrUpdate(String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters); + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2NetworkInner createOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, Context context); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName, Context context); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 delete(String resourceGroupName, String l2NetworkName); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 delete(String resourceGroupName, String l2NetworkName, Context context); + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkUpdateParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String l2NetworkName, + L2NetworkPatchParameters l2NetworkUpdateParameters, + Context context); + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L2NetworkInner update(String resourceGroupName, String l2NetworkName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java new file mode 100644 index 000000000000..ab4b920f5ac3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/L3NetworksClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.models.L3NetworkPatchParameters; + +/** An instance of this class provides access to all the operations defined in L3NetworksClient. */ +public interface L3NetworksClient { + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String l3NetworkName, Context context); + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3NetworkInner getByResourceGroup(String resourceGroupName, String l3NetworkName); + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation + * domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L3NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters); + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation + * domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, L3NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, Context context); + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3NetworkInner createOrUpdate(String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters); + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3NetworkInner createOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, Context context); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName, Context context); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 delete(String resourceGroupName, String l3NetworkName); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 delete(String resourceGroupName, String l3NetworkName, Context context); + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkUpdateParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String l3NetworkName, + L3NetworkPatchParameters l3NetworkUpdateParameters, + Context context); + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + L3NetworkInner update(String resourceGroupName, String l3NetworkName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java new file mode 100644 index 000000000000..b64df16e9af0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/MetricsConfigurationsClient.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationPatchParameters; + +/** An instance of this class provides access to all the operations defined in MetricsConfigurationsClient. */ +public interface MetricsConfigurationsClient { + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName); + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String metricsConfigurationName, Context context); + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterMetricsConfigurationInner get(String resourceGroupName, String clusterName, String metricsConfigurationName); + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterMetricsConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters); + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterMetricsConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + Context context); + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterMetricsConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters); + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterMetricsConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + Context context); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName, Context context); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String metricsConfigurationName); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context); + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterMetricsConfigurationInner> beginUpdate( + String resourceGroupName, String clusterName, String metricsConfigurationName); + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterMetricsConfigurationInner> beginUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + Context context); + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterMetricsConfigurationInner update( + String resourceGroupName, String clusterName, String metricsConfigurationName); + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterMetricsConfigurationInner update( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java new file mode 100644 index 000000000000..4df712917aa4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/NetworkCloud.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for NetworkCloud class. */ +public interface NetworkCloud { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the BareMetalMachinesClient object to access its operations. + * + * @return the BareMetalMachinesClient object. + */ + BareMetalMachinesClient getBareMetalMachines(); + + /** + * Gets the CloudServicesNetworksClient object to access its operations. + * + * @return the CloudServicesNetworksClient object. + */ + CloudServicesNetworksClient getCloudServicesNetworks(); + + /** + * Gets the ClusterManagersClient object to access its operations. + * + * @return the ClusterManagersClient object. + */ + ClusterManagersClient getClusterManagers(); + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the DefaultCniNetworksClient object to access its operations. + * + * @return the DefaultCniNetworksClient object. + */ + DefaultCniNetworksClient getDefaultCniNetworks(); + + /** + * Gets the HybridAksClustersClient object to access its operations. + * + * @return the HybridAksClustersClient object. + */ + HybridAksClustersClient getHybridAksClusters(); + + /** + * Gets the L2NetworksClient object to access its operations. + * + * @return the L2NetworksClient object. + */ + L2NetworksClient getL2Networks(); + + /** + * Gets the L3NetworksClient object to access its operations. + * + * @return the L3NetworksClient object. + */ + L3NetworksClient getL3Networks(); + + /** + * Gets the RackSkusClient object to access its operations. + * + * @return the RackSkusClient object. + */ + RackSkusClient getRackSkus(); + + /** + * Gets the RacksClient object to access its operations. + * + * @return the RacksClient object. + */ + RacksClient getRacks(); + + /** + * Gets the StorageAppliancesClient object to access its operations. + * + * @return the StorageAppliancesClient object. + */ + StorageAppliancesClient getStorageAppliances(); + + /** + * Gets the TrunkedNetworksClient object to access its operations. + * + * @return the TrunkedNetworksClient object. + */ + TrunkedNetworksClient getTrunkedNetworks(); + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + VirtualMachinesClient getVirtualMachines(); + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + VolumesClient getVolumes(); + + /** + * Gets the BareMetalMachineKeySetsClient object to access its operations. + * + * @return the BareMetalMachineKeySetsClient object. + */ + BareMetalMachineKeySetsClient getBareMetalMachineKeySets(); + + /** + * Gets the BmcKeySetsClient object to access its operations. + * + * @return the BmcKeySetsClient object. + */ + BmcKeySetsClient getBmcKeySets(); + + /** + * Gets the MetricsConfigurationsClient object to access its operations. + * + * @return the MetricsConfigurationsClient object. + */ + MetricsConfigurationsClient getMetricsConfigurations(); + + /** + * Gets the ConsolesClient object to access its operations. + * + * @return the ConsolesClient object. + */ + ConsolesClient getConsoles(); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java new file mode 100644 index 000000000000..c0d84ee978e6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/OperationsClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 a list of all available resource provider operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 a list of all available resource provider operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java new file mode 100644 index 000000000000..47603b44e7a5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RackSkusClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; + +/** An instance of this class provides access to all the operations defined in RackSkusClient. */ +public interface RackSkusClient { + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String rackSkuName, Context context); + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RackSkuInner get(String rackSkuName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java new file mode 100644 index 000000000000..1fd757767280 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/RacksClient.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.RackInner; +import com.azure.resourcemanager.networkcloud.models.RackPatchParameters; + +/** An instance of this class provides access to all the operations defined in RacksClient. */ +public interface RacksClient { + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 a list of racks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 a list of racks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of racks in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of racks in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String rackName, Context context); + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RackInner getByResourceGroup(String resourceGroupName, String rackName); + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RackInner> beginCreateOrUpdate( + String resourceGroupName, String rackName, RackInner rackParameters); + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RackInner> beginCreateOrUpdate( + String resourceGroupName, String rackName, RackInner rackParameters, Context context); + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RackInner createOrUpdate(String resourceGroupName, String rackName, RackInner rackParameters); + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RackInner createOrUpdate(String resourceGroupName, String rackName, RackInner rackParameters, Context context); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName, Context context); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 delete(String resourceGroupName, String rackName); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 delete(String resourceGroupName, String rackName, Context context); + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RackInner> beginUpdate(String resourceGroupName, String rackName); + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RackInner> beginUpdate( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context); + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RackInner update(String resourceGroupName, String rackName); + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RackInner update( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java new file mode 100644 index 000000000000..47da53276a3d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/StorageAppliancesClient.java @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.StorageApplianceInner; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; +import com.azure.resourcemanager.networkcloud.models.StorageAppliancePatchParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceValidateHardwareParameters; + +/** An instance of this class provides access to all the operations defined in StorageAppliancesClient. */ +public interface StorageAppliancesClient { + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 a list of storage appliances in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 a list of storage appliances in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of storage appliances in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of storage appliances in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String storageApplianceName, Context context); + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageApplianceInner getByResourceGroup(String resourceGroupName, String storageApplianceName); + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters); + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageApplianceInner> beginCreateOrUpdate( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + Context context); + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageApplianceInner createOrUpdate( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters); + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageApplianceInner createOrUpdate( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + Context context); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName, Context context); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 delete(String resourceGroupName, String storageApplianceName); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 delete(String resourceGroupName, String storageApplianceName, Context context); + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageApplianceInner> beginUpdate( + String resourceGroupName, String storageApplianceName); + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageApplianceInner> beginUpdate( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + Context context); + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageApplianceInner update(String resourceGroupName, String storageApplianceName); + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageApplianceInner update( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + Context context); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginDisableRemoteVendorManagement( + String resourceGroupName, String storageApplianceName); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginDisableRemoteVendorManagement( + String resourceGroupName, String storageApplianceName, Context context); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName, Context context); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginEnableRemoteVendorManagement( + String resourceGroupName, String storageApplianceName); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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> beginEnableRemoteVendorManagement( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 enableRemoteVendorManagement(String resourceGroupName, String storageApplianceName); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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 enableRemoteVendorManagement( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java new file mode 100644 index 000000000000..254569871ee5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/TrunkedNetworksClient.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.TrunkedNetworkInner; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkPatchParameters; + +/** An instance of this class provides access to all the operations defined in TrunkedNetworksClient. */ +public interface TrunkedNetworksClient { + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of trunked networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of trunked networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String trunkedNetworkName, Context context); + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrunkedNetworkInner getByResourceGroup(String resourceGroupName, String trunkedNetworkName); + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple + * isolation domains and specified VLANs to create a trunked network. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters); + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple + * isolation domains and specified VLANs to create a trunked network. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + Context context); + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrunkedNetworkInner createOrUpdate( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters); + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrunkedNetworkInner createOrUpdate( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + Context context); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName, Context context); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 delete(String resourceGroupName, String trunkedNetworkName); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 delete(String resourceGroupName, String trunkedNetworkName, Context context); + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkUpdateParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters, + Context context); + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrunkedNetworkInner update(String resourceGroupName, String trunkedNetworkName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java new file mode 100644 index 000000000000..59f5b960583d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VirtualMachinesClient.java @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePatchParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; + +/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +public interface VirtualMachinesClient { + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of virtual machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of virtual machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName); + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters); + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + Context context); + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner createOrUpdate( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters); + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner createOrUpdate( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + Context context); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName, Context context); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 delete(String resourceGroupName, String virtualMachineName); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 delete(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String virtualMachineName); + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + Context context); + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner update(String resourceGroupName, String virtualMachineName); + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInner update( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + Context context); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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> beginAttachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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> beginAttachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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> beginDetachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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> beginDetachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginPowerOff(String resourceGroupName, String virtualMachineName); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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> beginPowerOff( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 powerOff(String resourceGroupName, String virtualMachineName); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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 powerOff( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginReimage(String resourceGroupName, String virtualMachineName); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginReimage( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimage(String resourceGroupName, String virtualMachineName); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimage(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginRestart(String resourceGroupName, String virtualMachineName); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginRestart( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restart(String resourceGroupName, String virtualMachineName); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restart(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginStart(String resourceGroupName, String virtualMachineName); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginStart(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 start(String resourceGroupName, String virtualMachineName); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 start(String resourceGroupName, String virtualMachineName, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java new file mode 100644 index 000000000000..b0fffcc355f3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/VolumesClient.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent; + +import com.azure.core.annotation.ReturnType; +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.networkcloud.fluent.models.VolumeInner; +import com.azure.resourcemanager.networkcloud.models.VolumePatchParameters; + +/** An instance of this class provides access to all the operations defined in VolumesClient. */ +public interface VolumesClient { + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of volumes in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of volumes in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String volumeName, Context context); + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner getByResourceGroup(String resourceGroupName, String volumeName); + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources + * running on the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, String volumeName, VolumeInner volumeParameters); + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources + * running on the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, Context context); + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner createOrUpdate(String resourceGroupName, String volumeName, VolumeInner volumeParameters); + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner createOrUpdate( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, Context context); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName, Context context); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 delete(String resourceGroupName, String volumeName); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 delete(String resourceGroupName, String volumeName, Context context); + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeUpdateParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String volumeName, VolumePatchParameters volumeUpdateParameters, Context context); + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volume represents storage made available for use by resources running on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner update(String resourceGroupName, String volumeName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java new file mode 100644 index 000000000000..a4ba9bd2485a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineInner.java @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineProvisioningState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReadyState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HardwareInventory; +import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** BareMetalMachine represents the physical machine in the rack. */ +@Fluent +public final class BareMetalMachineInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * BareMetalMachineProperties represents the properties of a bare metal machine. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private BareMetalMachineProperties innerProperties = new BareMetalMachineProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of BareMetalMachineInner class. */ + public BareMetalMachineInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: BareMetalMachineProperties represents the properties of a bare metal machine. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private BareMetalMachineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public BareMetalMachineInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BareMetalMachineInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the bmcConnectionString property: The connection string for the baseboard management controller including IP + * address and protocol. + * + * @return the bmcConnectionString value. + */ + public String bmcConnectionString() { + return this.innerProperties() == null ? null : this.innerProperties().bmcConnectionString(); + } + + /** + * Set the bmcConnectionString property: The connection string for the baseboard management controller including IP + * address and protocol. + * + * @param bmcConnectionString the bmcConnectionString value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withBmcConnectionString(String bmcConnectionString) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withBmcConnectionString(bmcConnectionString); + return this; + } + + /** + * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @return the bmcCredentials value. + */ + public AdministrativeCredentials bmcCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().bmcCredentials(); + } + + /** + * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @param bmcCredentials the bmcCredentials value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withBmcCredentials(AdministrativeCredentials bmcCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withBmcCredentials(bmcCredentials); + return this; + } + + /** + * Get the bmcMacAddress property: The MAC address of the BMC device. + * + * @return the bmcMacAddress value. + */ + public String bmcMacAddress() { + return this.innerProperties() == null ? null : this.innerProperties().bmcMacAddress(); + } + + /** + * Set the bmcMacAddress property: The MAC address of the BMC device. + * + * @param bmcMacAddress the bmcMacAddress value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withBmcMacAddress(String bmcMacAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withBmcMacAddress(bmcMacAddress); + return this; + } + + /** + * Get the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @return the bootMacAddress value. + */ + public String bootMacAddress() { + return this.innerProperties() == null ? null : this.innerProperties().bootMacAddress(); + } + + /** + * Set the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @param bootMacAddress the bootMacAddress value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withBootMacAddress(String bootMacAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withBootMacAddress(bootMacAddress); + return this; + } + + /** + * Get the clusterId property: The resource ID of the cluster this bare metal machine is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the cordonStatus property: The cordon status of the bare metal machine. + * + * @return the cordonStatus value. + */ + public BareMetalMachineCordonStatus cordonStatus() { + return this.innerProperties() == null ? null : this.innerProperties().cordonStatus(); + } + + /** + * Get the detailedStatus property: The more detailed status of the bare metal machine. + * + * @return the detailedStatus value. + */ + public BareMetalMachineDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the hardwareInventory property: HardwareInventory represents the hardware configuration of this machine as + * exposed to the customer, including information acquired from the model/sku information and from the ironic + * inspector. + * + *

The hardware inventory, including information acquired from the model/sku information and from the ironic + * inspector. + * + * @return the hardwareInventory value. + */ + public HardwareInventory hardwareInventory() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareInventory(); + } + + /** + * Get the hardwareValidationStatus property: HardwareValidationStatus represents the latest hardware validation + * details performed for this bare metal machine. + * + *

The details of the latest hardware validation performed for this bare metal machine. + * + * @return the hardwareValidationStatus value. + */ + public HardwareValidationStatus hardwareValidationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareValidationStatus(); + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of the resource IDs for the HybridAksClusters that have + * nodes hosted on this bare metal machine. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksClustersAssociatedIds(); + } + + /** + * Get the kubernetesNodeName property: The name of this machine represented by the host object in the Cluster's + * Kubernetes control plane. + * + * @return the kubernetesNodeName value. + */ + public String kubernetesNodeName() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesNodeName(); + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes running on this machine. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); + } + + /** + * Get the machineDetails property: The custom details provided by the customer. + * + * @return the machineDetails value. + */ + public String machineDetails() { + return this.innerProperties() == null ? null : this.innerProperties().machineDetails(); + } + + /** + * Set the machineDetails property: The custom details provided by the customer. + * + * @param machineDetails the machineDetails value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withMachineDetails(String machineDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withMachineDetails(machineDetails); + return this; + } + + /** + * Get the machineName property: The OS-level hostname assigned to this machine. + * + * @return the machineName value. + */ + public String machineName() { + return this.innerProperties() == null ? null : this.innerProperties().machineName(); + } + + /** + * Set the machineName property: The OS-level hostname assigned to this machine. + * + * @param machineName the machineName value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withMachineName(String machineName) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withMachineName(machineName); + return this; + } + + /** + * Get the machineSkuId property: The unique internal identifier of the bare metal machine SKU. + * + * @return the machineSkuId value. + */ + public String machineSkuId() { + return this.innerProperties() == null ? null : this.innerProperties().machineSkuId(); + } + + /** + * Set the machineSkuId property: The unique internal identifier of the bare metal machine SKU. + * + * @param machineSkuId the machineSkuId value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withMachineSkuId(String machineSkuId) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withMachineSkuId(machineSkuId); + return this; + } + + /** + * Get the oamIpv4Address property: The IPv4 address that is assigned to the bare metal machine during the cluster + * deployment. + * + * @return the oamIpv4Address value. + */ + public String oamIpv4Address() { + return this.innerProperties() == null ? null : this.innerProperties().oamIpv4Address(); + } + + /** + * Get the oamIpv6Address property: The IPv6 address that is assigned to the bare metal machine during the cluster + * deployment. + * + * @return the oamIpv6Address value. + */ + public String oamIpv6Address() { + return this.innerProperties() == null ? null : this.innerProperties().oamIpv6Address(); + } + + /** + * Get the osImage property: The image that is currently provisioned to the OS disk. + * + * @return the osImage value. + */ + public String osImage() { + return this.innerProperties() == null ? null : this.innerProperties().osImage(); + } + + /** + * Get the powerState property: The power state derived from the baseboard management controller. + * + * @return the powerState value. + */ + public BareMetalMachinePowerState powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Get the provisioningState property: The provisioning state of the bare metal machine. + * + * @return the provisioningState value. + */ + public BareMetalMachineProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the rackId property: The resource ID of the rack where this bare metal machine resides. + * + * @return the rackId value. + */ + public String rackId() { + return this.innerProperties() == null ? null : this.innerProperties().rackId(); + } + + /** + * Set the rackId property: The resource ID of the rack where this bare metal machine resides. + * + * @param rackId the rackId value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withRackId(String rackId) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withRackId(rackId); + return this; + } + + /** + * Get the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up + * i.e. the lowest slot is 1. + * + * @return the rackSlot value. + */ + public long rackSlot() { + return this.innerProperties() == null ? 0L : this.innerProperties().rackSlot(); + } + + /** + * Set the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up + * i.e. the lowest slot is 1. + * + * @param rackSlot the rackSlot value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withRackSlot(long rackSlot) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withRackSlot(rackSlot); + return this; + } + + /** + * Get the readyState property: The indicator of whether the bare metal machine is ready to receive workloads. + * + * @return the readyState value. + */ + public BareMetalMachineReadyState readyState() { + return this.innerProperties() == null ? null : this.innerProperties().readyState(); + } + + /** + * Get the serialNumber property: The serial number of the bare metal machine. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Set the serialNumber property: The serial number of the bare metal machine. + * + * @param serialNumber the serialNumber value to set. + * @return the BareMetalMachineInner object itself. + */ + public BareMetalMachineInner withSerialNumber(String serialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineProperties(); + } + this.innerProperties().withSerialNumber(serialNumber); + return this; + } + + /** + * Get the serviceTag property: The discovered value of the machine's service tag. + * + * @return the serviceTag value. + */ + public String serviceTag() { + return this.innerProperties() == null ? null : this.innerProperties().serviceTag(); + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of the resource IDs for the VirtualMachines that are + * hosted on this bare metal machine. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociatedIds(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model BareMetalMachineInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model BareMetalMachineInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java new file mode 100644 index 000000000000..5e0a4a325126 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetInner.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** BareMetalMachineKeySet represents the bare metal machine key set. */ +@Fluent +public final class BareMetalMachineKeySetInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private BareMetalMachineKeySetProperties innerProperties = new BareMetalMachineKeySetProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of BareMetalMachineKeySetInner class. */ + public BareMetalMachineKeySetInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: BareMetalMachineKeySetProperties represents the properties of bare metal + * machine key set. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private BareMetalMachineKeySetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public BareMetalMachineKeySetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BareMetalMachineKeySetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @return the azureGroupId value. + */ + public String azureGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().azureGroupId(); + } + + /** + * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @param azureGroupId the azureGroupId value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withAzureGroupId(String azureGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetProperties(); + } + this.innerProperties().withAzureGroupId(azureGroupId); + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the key set. + * + * @return the detailedStatus value. + */ + public BareMetalMachineKeySetDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @param expiration the expiration value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @return the jumpHostsAllowed value. + */ + public List jumpHostsAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().jumpHostsAllowed(); + } + + /** + * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @param jumpHostsAllowed the jumpHostsAllowed value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withJumpHostsAllowed(List jumpHostsAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetProperties(); + } + this.innerProperties().withJumpHostsAllowed(jumpHostsAllowed); + return this; + } + + /** + * Get the lastValidation property: The last time this key set was validated. + * + * @return the lastValidation value. + */ + public OffsetDateTime lastValidation() { + return this.innerProperties() == null ? null : this.innerProperties().lastValidation(); + } + + /** + * Get the osGroupName property: The name of the group that users will be assigned to on the operating system of the + * machines. + * + * @return the osGroupName value. + */ + public String osGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().osGroupName(); + } + + /** + * Set the osGroupName property: The name of the group that users will be assigned to on the operating system of the + * machines. + * + * @param osGroupName the osGroupName value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withOsGroupName(String osGroupName) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetProperties(); + } + this.innerProperties().withOsGroupName(osGroupName); + return this; + } + + /** + * Get the privilegeLevel property: The access level allowed for the users in this key set. + * + * @return the privilegeLevel value. + */ + public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { + return this.innerProperties() == null ? null : this.innerProperties().privilegeLevel(); + } + + /** + * Set the privilegeLevel property: The access level allowed for the users in this key set. + * + * @param privilegeLevel the privilegeLevel value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel privilegeLevel) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetProperties(); + } + this.innerProperties().withPrivilegeLevel(privilegeLevel); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the bare metal machine key set. + * + * @return the provisioningState value. + */ + public BareMetalMachineKeySetProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.innerProperties() == null ? null : this.innerProperties().userList(); + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BareMetalMachineKeySetInner object itself. + */ + public BareMetalMachineKeySetInner withUserList(List userList) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetProperties(); + } + this.innerProperties().withUserList(userList); + return this; + } + + /** + * Get the userListStatus property: The status evaluation of each user. + * + * @return the userListStatus value. + */ + public List userListStatus() { + return this.innerProperties() == null ? null : this.innerProperties().userListStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model BareMetalMachineKeySetInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model BareMetalMachineKeySetInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineKeySetInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java new file mode 100644 index 000000000000..5ea33013088d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetPatchProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. + */ +@Fluent +public final class BareMetalMachineKeySetPatchProperties { + /* + * The date and time after which the users in this key set will be removed from the bare metal machines. + */ + @JsonProperty(value = "expiration") + private OffsetDateTime expiration; + + /* + * The list of IP addresses of jump hosts with management network access from which a login will be allowed for the + * users. + */ + @JsonProperty(value = "jumpHostsAllowed") + private List jumpHostsAllowed; + + /* + * The unique list of permitted users. + */ + @JsonProperty(value = "userList") + private List userList; + + /** Creates an instance of BareMetalMachineKeySetPatchProperties class. */ + public BareMetalMachineKeySetPatchProperties() { + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @param expiration the expiration value to set. + * @return the BareMetalMachineKeySetPatchProperties object itself. + */ + public BareMetalMachineKeySetPatchProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @return the jumpHostsAllowed value. + */ + public List jumpHostsAllowed() { + return this.jumpHostsAllowed; + } + + /** + * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @param jumpHostsAllowed the jumpHostsAllowed value to set. + * @return the BareMetalMachineKeySetPatchProperties object itself. + */ + public BareMetalMachineKeySetPatchProperties withJumpHostsAllowed(List jumpHostsAllowed) { + this.jumpHostsAllowed = jumpHostsAllowed; + return this; + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.userList; + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BareMetalMachineKeySetPatchProperties object itself. + */ + public BareMetalMachineKeySetPatchProperties withUserList(List userList) { + this.userList = userList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userList() != null) { + userList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java new file mode 100644 index 000000000000..0cd052690292 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineKeySetProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetProvisioningState; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. */ +@Fluent +public final class BareMetalMachineKeySetProperties { + /* + * The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. + * Users that are not in the group will not have access. + */ + @JsonProperty(value = "azureGroupId", required = true) + private String azureGroupId; + + /* + * The more detailed status of the key set. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineKeySetDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The date and time after which the users in this key set will be removed from the bare metal machines. + */ + @JsonProperty(value = "expiration", required = true) + private OffsetDateTime expiration; + + /* + * The list of IP addresses of jump hosts with management network access from which a login will be allowed for the + * users. + */ + @JsonProperty(value = "jumpHostsAllowed", required = true) + private List jumpHostsAllowed; + + /* + * The last time this key set was validated. + */ + @JsonProperty(value = "lastValidation", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastValidation; + + /* + * The name of the group that users will be assigned to on the operating system of the machines. + */ + @JsonProperty(value = "osGroupName") + private String osGroupName; + + /* + * The access level allowed for the users in this key set. + */ + @JsonProperty(value = "privilegeLevel", required = true) + private BareMetalMachineKeySetPrivilegeLevel privilegeLevel; + + /* + * The provisioning state of the bare metal machine key set. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineKeySetProvisioningState provisioningState; + + /* + * The unique list of permitted users. + */ + @JsonProperty(value = "userList", required = true) + private List userList; + + /* + * The status evaluation of each user. + */ + @JsonProperty(value = "userListStatus", access = JsonProperty.Access.WRITE_ONLY) + private List userListStatus; + + /** Creates an instance of BareMetalMachineKeySetProperties class. */ + public BareMetalMachineKeySetProperties() { + } + + /** + * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @return the azureGroupId value. + */ + public String azureGroupId() { + return this.azureGroupId; + } + + /** + * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @param azureGroupId the azureGroupId value to set. + * @return the BareMetalMachineKeySetProperties object itself. + */ + public BareMetalMachineKeySetProperties withAzureGroupId(String azureGroupId) { + this.azureGroupId = azureGroupId; + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the key set. + * + * @return the detailedStatus value. + */ + public BareMetalMachineKeySetDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @param expiration the expiration value to set. + * @return the BareMetalMachineKeySetProperties object itself. + */ + public BareMetalMachineKeySetProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @return the jumpHostsAllowed value. + */ + public List jumpHostsAllowed() { + return this.jumpHostsAllowed; + } + + /** + * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @param jumpHostsAllowed the jumpHostsAllowed value to set. + * @return the BareMetalMachineKeySetProperties object itself. + */ + public BareMetalMachineKeySetProperties withJumpHostsAllowed(List jumpHostsAllowed) { + this.jumpHostsAllowed = jumpHostsAllowed; + return this; + } + + /** + * Get the lastValidation property: The last time this key set was validated. + * + * @return the lastValidation value. + */ + public OffsetDateTime lastValidation() { + return this.lastValidation; + } + + /** + * Get the osGroupName property: The name of the group that users will be assigned to on the operating system of the + * machines. + * + * @return the osGroupName value. + */ + public String osGroupName() { + return this.osGroupName; + } + + /** + * Set the osGroupName property: The name of the group that users will be assigned to on the operating system of the + * machines. + * + * @param osGroupName the osGroupName value to set. + * @return the BareMetalMachineKeySetProperties object itself. + */ + public BareMetalMachineKeySetProperties withOsGroupName(String osGroupName) { + this.osGroupName = osGroupName; + return this; + } + + /** + * Get the privilegeLevel property: The access level allowed for the users in this key set. + * + * @return the privilegeLevel value. + */ + public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { + return this.privilegeLevel; + } + + /** + * Set the privilegeLevel property: The access level allowed for the users in this key set. + * + * @param privilegeLevel the privilegeLevel value to set. + * @return the BareMetalMachineKeySetProperties object itself. + */ + public BareMetalMachineKeySetProperties withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel privilegeLevel) { + this.privilegeLevel = privilegeLevel; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the bare metal machine key set. + * + * @return the provisioningState value. + */ + public BareMetalMachineKeySetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.userList; + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BareMetalMachineKeySetProperties object itself. + */ + public BareMetalMachineKeySetProperties withUserList(List userList) { + this.userList = userList; + return this; + } + + /** + * Get the userListStatus property: The status evaluation of each user. + * + * @return the userListStatus value. + */ + public List userListStatus() { + return this.userListStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureGroupId in model BareMetalMachineKeySetProperties")); + } + if (expiration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property expiration in model BareMetalMachineKeySetProperties")); + } + if (jumpHostsAllowed() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property jumpHostsAllowed in model BareMetalMachineKeySetProperties")); + } + if (privilegeLevel() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privilegeLevel in model BareMetalMachineKeySetProperties")); + } + if (userList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property userList in model BareMetalMachineKeySetProperties")); + } else { + userList().forEach(e -> e.validate()); + } + if (userListStatus() != null) { + userListStatus().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineKeySetProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java new file mode 100644 index 000000000000..1ebe3c31ee63 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachinePatchProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BareMetalMachinePatchProperties represents the properties of the bare metal machine that can be patched. */ +@Fluent +public final class BareMetalMachinePatchProperties { + /* + * The details provided by the customer during the creation of rack manifests + * that allows for custom data to be associated with this machine. + */ + @JsonProperty(value = "machineDetails") + private String machineDetails; + + /** Creates an instance of BareMetalMachinePatchProperties class. */ + public BareMetalMachinePatchProperties() { + } + + /** + * Get the machineDetails property: The details provided by the customer during the creation of rack manifests that + * allows for custom data to be associated with this machine. + * + * @return the machineDetails value. + */ + public String machineDetails() { + return this.machineDetails; + } + + /** + * Set the machineDetails property: The details provided by the customer during the creation of rack manifests that + * allows for custom data to be associated with this machine. + * + * @param machineDetails the machineDetails value to set. + * @return the BareMetalMachinePatchProperties object itself. + */ + public BareMetalMachinePatchProperties withMachineDetails(String machineDetails) { + this.machineDetails = machineDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java new file mode 100644 index 000000000000..7d42db3914fb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BareMetalMachineProperties.java @@ -0,0 +1,646 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineProvisioningState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReadyState; +import com.azure.resourcemanager.networkcloud.models.HardwareInventory; +import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BareMetalMachineProperties represents the properties of a bare metal machine. */ +@Fluent +public final class BareMetalMachineProperties { + /* + * The connection string for the baseboard management controller including IP address and protocol. + */ + @JsonProperty(value = "bmcConnectionString", required = true) + private String bmcConnectionString; + + /* + * AdministrativeCredentials represents the admin credentials for the device requiring password-based + * authentication. + * + * The credentials of the baseboard management controller on this bare metal machine. + */ + @JsonProperty(value = "bmcCredentials", required = true) + private AdministrativeCredentials bmcCredentials; + + /* + * The MAC address of the BMC device. + */ + @JsonProperty(value = "bmcMacAddress", required = true) + private String bmcMacAddress; + + /* + * The MAC address of a NIC connected to the PXE network. + */ + @JsonProperty(value = "bootMacAddress", required = true) + private String bootMacAddress; + + /* + * The resource ID of the cluster this bare metal machine is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The cordon status of the bare metal machine. + */ + @JsonProperty(value = "cordonStatus", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineCordonStatus cordonStatus; + + /* + * The more detailed status of the bare metal machine. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including + * information acquired from the model/sku information and from the ironic inspector. + * + * The hardware inventory, including information acquired from the model/sku information and from the ironic + * inspector. + */ + @JsonProperty(value = "hardwareInventory", access = JsonProperty.Access.WRITE_ONLY) + private HardwareInventory hardwareInventory; + + /* + * HardwareValidationStatus represents the latest hardware validation details performed for this bare metal + * machine. + * + * The details of the latest hardware validation performed for this bare metal machine. + */ + @JsonProperty(value = "hardwareValidationStatus", access = JsonProperty.Access.WRITE_ONLY) + private HardwareValidationStatus hardwareValidationStatus; + + /* + * The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine. + */ + @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List hybridAksClustersAssociatedIds; + + /* + * The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + */ + @JsonProperty(value = "kubernetesNodeName", access = JsonProperty.Access.WRITE_ONLY) + private String kubernetesNodeName; + + /* + * The version of Kubernetes running on this machine. + */ + @JsonProperty(value = "kubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kubernetesVersion; + + /* + * The custom details provided by the customer. + */ + @JsonProperty(value = "machineDetails", required = true) + private String machineDetails; + + /* + * The OS-level hostname assigned to this machine. + */ + @JsonProperty(value = "machineName", required = true) + private String machineName; + + /* + * The unique internal identifier of the bare metal machine SKU. + */ + @JsonProperty(value = "machineSkuId", required = true) + private String machineSkuId; + + /* + * The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + */ + @JsonProperty(value = "oamIpv4Address", access = JsonProperty.Access.WRITE_ONLY) + private String oamIpv4Address; + + /* + * The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + */ + @JsonProperty(value = "oamIpv6Address", access = JsonProperty.Access.WRITE_ONLY) + private String oamIpv6Address; + + /* + * The image that is currently provisioned to the OS disk. + */ + @JsonProperty(value = "osImage", access = JsonProperty.Access.WRITE_ONLY) + private String osImage; + + /* + * The power state derived from the baseboard management controller. + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachinePowerState powerState; + + /* + * The provisioning state of the bare metal machine. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineProvisioningState provisioningState; + + /* + * The resource ID of the rack where this bare metal machine resides. + */ + @JsonProperty(value = "rackId", required = true) + private String rackId; + + /* + * The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + */ + @JsonProperty(value = "rackSlot", required = true) + private long rackSlot; + + /* + * The indicator of whether the bare metal machine is ready to receive workloads. + */ + @JsonProperty(value = "readyState", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineReadyState readyState; + + /* + * The serial number of the bare metal machine. + */ + @JsonProperty(value = "serialNumber", required = true) + private String serialNumber; + + /* + * The discovered value of the machine's service tag. + */ + @JsonProperty(value = "serviceTag", access = JsonProperty.Access.WRITE_ONLY) + private String serviceTag; + + /* + * The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine. + */ + @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociatedIds; + + /** Creates an instance of BareMetalMachineProperties class. */ + public BareMetalMachineProperties() { + } + + /** + * Get the bmcConnectionString property: The connection string for the baseboard management controller including IP + * address and protocol. + * + * @return the bmcConnectionString value. + */ + public String bmcConnectionString() { + return this.bmcConnectionString; + } + + /** + * Set the bmcConnectionString property: The connection string for the baseboard management controller including IP + * address and protocol. + * + * @param bmcConnectionString the bmcConnectionString value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withBmcConnectionString(String bmcConnectionString) { + this.bmcConnectionString = bmcConnectionString; + return this; + } + + /** + * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @return the bmcCredentials value. + */ + public AdministrativeCredentials bmcCredentials() { + return this.bmcCredentials; + } + + /** + * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @param bmcCredentials the bmcCredentials value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withBmcCredentials(AdministrativeCredentials bmcCredentials) { + this.bmcCredentials = bmcCredentials; + return this; + } + + /** + * Get the bmcMacAddress property: The MAC address of the BMC device. + * + * @return the bmcMacAddress value. + */ + public String bmcMacAddress() { + return this.bmcMacAddress; + } + + /** + * Set the bmcMacAddress property: The MAC address of the BMC device. + * + * @param bmcMacAddress the bmcMacAddress value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withBmcMacAddress(String bmcMacAddress) { + this.bmcMacAddress = bmcMacAddress; + return this; + } + + /** + * Get the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @return the bootMacAddress value. + */ + public String bootMacAddress() { + return this.bootMacAddress; + } + + /** + * Set the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @param bootMacAddress the bootMacAddress value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withBootMacAddress(String bootMacAddress) { + this.bootMacAddress = bootMacAddress; + return this; + } + + /** + * Get the clusterId property: The resource ID of the cluster this bare metal machine is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the cordonStatus property: The cordon status of the bare metal machine. + * + * @return the cordonStatus value. + */ + public BareMetalMachineCordonStatus cordonStatus() { + return this.cordonStatus; + } + + /** + * Get the detailedStatus property: The more detailed status of the bare metal machine. + * + * @return the detailedStatus value. + */ + public BareMetalMachineDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the hardwareInventory property: HardwareInventory represents the hardware configuration of this machine as + * exposed to the customer, including information acquired from the model/sku information and from the ironic + * inspector. + * + *

The hardware inventory, including information acquired from the model/sku information and from the ironic + * inspector. + * + * @return the hardwareInventory value. + */ + public HardwareInventory hardwareInventory() { + return this.hardwareInventory; + } + + /** + * Get the hardwareValidationStatus property: HardwareValidationStatus represents the latest hardware validation + * details performed for this bare metal machine. + * + *

The details of the latest hardware validation performed for this bare metal machine. + * + * @return the hardwareValidationStatus value. + */ + public HardwareValidationStatus hardwareValidationStatus() { + return this.hardwareValidationStatus; + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of the resource IDs for the HybridAksClusters that have + * nodes hosted on this bare metal machine. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.hybridAksClustersAssociatedIds; + } + + /** + * Get the kubernetesNodeName property: The name of this machine represented by the host object in the Cluster's + * Kubernetes control plane. + * + * @return the kubernetesNodeName value. + */ + public String kubernetesNodeName() { + return this.kubernetesNodeName; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes running on this machine. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the machineDetails property: The custom details provided by the customer. + * + * @return the machineDetails value. + */ + public String machineDetails() { + return this.machineDetails; + } + + /** + * Set the machineDetails property: The custom details provided by the customer. + * + * @param machineDetails the machineDetails value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withMachineDetails(String machineDetails) { + this.machineDetails = machineDetails; + return this; + } + + /** + * Get the machineName property: The OS-level hostname assigned to this machine. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Set the machineName property: The OS-level hostname assigned to this machine. + * + * @param machineName the machineName value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withMachineName(String machineName) { + this.machineName = machineName; + return this; + } + + /** + * Get the machineSkuId property: The unique internal identifier of the bare metal machine SKU. + * + * @return the machineSkuId value. + */ + public String machineSkuId() { + return this.machineSkuId; + } + + /** + * Set the machineSkuId property: The unique internal identifier of the bare metal machine SKU. + * + * @param machineSkuId the machineSkuId value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withMachineSkuId(String machineSkuId) { + this.machineSkuId = machineSkuId; + return this; + } + + /** + * Get the oamIpv4Address property: The IPv4 address that is assigned to the bare metal machine during the cluster + * deployment. + * + * @return the oamIpv4Address value. + */ + public String oamIpv4Address() { + return this.oamIpv4Address; + } + + /** + * Get the oamIpv6Address property: The IPv6 address that is assigned to the bare metal machine during the cluster + * deployment. + * + * @return the oamIpv6Address value. + */ + public String oamIpv6Address() { + return this.oamIpv6Address; + } + + /** + * Get the osImage property: The image that is currently provisioned to the OS disk. + * + * @return the osImage value. + */ + public String osImage() { + return this.osImage; + } + + /** + * Get the powerState property: The power state derived from the baseboard management controller. + * + * @return the powerState value. + */ + public BareMetalMachinePowerState powerState() { + return this.powerState; + } + + /** + * Get the provisioningState property: The provisioning state of the bare metal machine. + * + * @return the provisioningState value. + */ + public BareMetalMachineProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the rackId property: The resource ID of the rack where this bare metal machine resides. + * + * @return the rackId value. + */ + public String rackId() { + return this.rackId; + } + + /** + * Set the rackId property: The resource ID of the rack where this bare metal machine resides. + * + * @param rackId the rackId value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withRackId(String rackId) { + this.rackId = rackId; + return this; + } + + /** + * Get the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up + * i.e. the lowest slot is 1. + * + * @return the rackSlot value. + */ + public long rackSlot() { + return this.rackSlot; + } + + /** + * Set the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up + * i.e. the lowest slot is 1. + * + * @param rackSlot the rackSlot value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withRackSlot(long rackSlot) { + this.rackSlot = rackSlot; + return this; + } + + /** + * Get the readyState property: The indicator of whether the bare metal machine is ready to receive workloads. + * + * @return the readyState value. + */ + public BareMetalMachineReadyState readyState() { + return this.readyState; + } + + /** + * Get the serialNumber property: The serial number of the bare metal machine. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number of the bare metal machine. + * + * @param serialNumber the serialNumber value to set. + * @return the BareMetalMachineProperties object itself. + */ + public BareMetalMachineProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the serviceTag property: The discovered value of the machine's service tag. + * + * @return the serviceTag value. + */ + public String serviceTag() { + return this.serviceTag; + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of the resource IDs for the VirtualMachines that are + * hosted on this bare metal machine. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.virtualMachinesAssociatedIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bmcConnectionString() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bmcConnectionString in model BareMetalMachineProperties")); + } + if (bmcCredentials() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bmcCredentials in model BareMetalMachineProperties")); + } else { + bmcCredentials().validate(); + } + if (bmcMacAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bmcMacAddress in model BareMetalMachineProperties")); + } + if (bootMacAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bootMacAddress in model BareMetalMachineProperties")); + } + if (hardwareInventory() != null) { + hardwareInventory().validate(); + } + if (hardwareValidationStatus() != null) { + hardwareValidationStatus().validate(); + } + if (machineDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property machineDetails in model BareMetalMachineProperties")); + } + if (machineName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property machineName in model BareMetalMachineProperties")); + } + if (machineSkuId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property machineSkuId in model BareMetalMachineProperties")); + } + if (rackId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rackId in model BareMetalMachineProperties")); + } + if (serialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serialNumber in model BareMetalMachineProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java new file mode 100644 index 000000000000..2ba7db4f925a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetInner.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** BmcKeySet represents the baseboard management controller key set. */ +@Fluent +public final class BmcKeySetInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * BmcKeySetProperties represents the properties of baseboard management controller key set. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private BmcKeySetProperties innerProperties = new BmcKeySetProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of BmcKeySetInner class. */ + public BmcKeySetInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the BmcKeySetInner object itself. + */ + public BmcKeySetInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: BmcKeySetProperties represents the properties of baseboard management + * controller key set. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private BmcKeySetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public BmcKeySetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BmcKeySetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @return the azureGroupId value. + */ + public String azureGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().azureGroupId(); + } + + /** + * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @param azureGroupId the azureGroupId value to set. + * @return the BmcKeySetInner object itself. + */ + public BmcKeySetInner withAzureGroupId(String azureGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new BmcKeySetProperties(); + } + this.innerProperties().withAzureGroupId(azureGroupId); + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the key set. + * + * @return the detailedStatus value. + */ + public BmcKeySetDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @param expiration the expiration value to set. + * @return the BmcKeySetInner object itself. + */ + public BmcKeySetInner withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new BmcKeySetProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Get the lastValidation property: The last time this key set was validated. + * + * @return the lastValidation value. + */ + public OffsetDateTime lastValidation() { + return this.innerProperties() == null ? null : this.innerProperties().lastValidation(); + } + + /** + * Get the privilegeLevel property: The access level allowed for the users in this key set. + * + * @return the privilegeLevel value. + */ + public BmcKeySetPrivilegeLevel privilegeLevel() { + return this.innerProperties() == null ? null : this.innerProperties().privilegeLevel(); + } + + /** + * Set the privilegeLevel property: The access level allowed for the users in this key set. + * + * @param privilegeLevel the privilegeLevel value to set. + * @return the BmcKeySetInner object itself. + */ + public BmcKeySetInner withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeLevel) { + if (this.innerProperties() == null) { + this.innerProperties = new BmcKeySetProperties(); + } + this.innerProperties().withPrivilegeLevel(privilegeLevel); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the baseboard management controller key set. + * + * @return the provisioningState value. + */ + public BmcKeySetProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.innerProperties() == null ? null : this.innerProperties().userList(); + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BmcKeySetInner object itself. + */ + public BmcKeySetInner withUserList(List userList) { + if (this.innerProperties() == null) { + this.innerProperties = new BmcKeySetProperties(); + } + this.innerProperties().withUserList(userList); + return this; + } + + /** + * Get the userListStatus property: The status evaluation of each user. + * + * @return the userListStatus value. + */ + public List userListStatus() { + return this.innerProperties() == null ? null : this.innerProperties().userListStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model BmcKeySetInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model BmcKeySetInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BmcKeySetInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java new file mode 100644 index 000000000000..0c7a3c4758c5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetPatchProperties.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. */ +@Fluent +public final class BmcKeySetPatchProperties { + /* + * The date and time after which the users in this key set will be removed from the baseboard management + * controllers. + */ + @JsonProperty(value = "expiration") + private OffsetDateTime expiration; + + /* + * The unique list of permitted users. + */ + @JsonProperty(value = "userList") + private List userList; + + /** Creates an instance of BmcKeySetPatchProperties class. */ + public BmcKeySetPatchProperties() { + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @param expiration the expiration value to set. + * @return the BmcKeySetPatchProperties object itself. + */ + public BmcKeySetPatchProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.userList; + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BmcKeySetPatchProperties object itself. + */ + public BmcKeySetPatchProperties withUserList(List userList) { + this.userList = userList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userList() != null) { + userList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java new file mode 100644 index 000000000000..d9e87482ee48 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/BmcKeySetProperties.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetProvisioningState; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** BmcKeySetProperties represents the properties of baseboard management controller key set. */ +@Fluent +public final class BmcKeySetProperties { + /* + * The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. + * Users that are not in the group will not have access. + */ + @JsonProperty(value = "azureGroupId", required = true) + private String azureGroupId; + + /* + * The more detailed status of the key set. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private BmcKeySetDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The date and time after which the users in this key set will be removed from the baseboard management + * controllers. + */ + @JsonProperty(value = "expiration", required = true) + private OffsetDateTime expiration; + + /* + * The last time this key set was validated. + */ + @JsonProperty(value = "lastValidation", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastValidation; + + /* + * The access level allowed for the users in this key set. + */ + @JsonProperty(value = "privilegeLevel", required = true) + private BmcKeySetPrivilegeLevel privilegeLevel; + + /* + * The provisioning state of the baseboard management controller key set. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BmcKeySetProvisioningState provisioningState; + + /* + * The unique list of permitted users. + */ + @JsonProperty(value = "userList", required = true) + private List userList; + + /* + * The status evaluation of each user. + */ + @JsonProperty(value = "userListStatus", access = JsonProperty.Access.WRITE_ONLY) + private List userListStatus; + + /** Creates an instance of BmcKeySetProperties class. */ + public BmcKeySetProperties() { + } + + /** + * Get the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @return the azureGroupId value. + */ + public String azureGroupId() { + return this.azureGroupId; + } + + /** + * Set the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @param azureGroupId the azureGroupId value to set. + * @return the BmcKeySetProperties object itself. + */ + public BmcKeySetProperties withAzureGroupId(String azureGroupId) { + this.azureGroupId = azureGroupId; + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the key set. + * + * @return the detailedStatus value. + */ + public BmcKeySetDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @param expiration the expiration value to set. + * @return the BmcKeySetProperties object itself. + */ + public BmcKeySetProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get the lastValidation property: The last time this key set was validated. + * + * @return the lastValidation value. + */ + public OffsetDateTime lastValidation() { + return this.lastValidation; + } + + /** + * Get the privilegeLevel property: The access level allowed for the users in this key set. + * + * @return the privilegeLevel value. + */ + public BmcKeySetPrivilegeLevel privilegeLevel() { + return this.privilegeLevel; + } + + /** + * Set the privilegeLevel property: The access level allowed for the users in this key set. + * + * @param privilegeLevel the privilegeLevel value to set. + * @return the BmcKeySetProperties object itself. + */ + public BmcKeySetProperties withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeLevel) { + this.privilegeLevel = privilegeLevel; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the baseboard management controller key set. + * + * @return the provisioningState value. + */ + public BmcKeySetProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.userList; + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BmcKeySetProperties object itself. + */ + public BmcKeySetProperties withUserList(List userList) { + this.userList = userList; + return this; + } + + /** + * Get the userListStatus property: The status evaluation of each user. + * + * @return the userListStatus value. + */ + public List userListStatus() { + return this.userListStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureGroupId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureGroupId in model BmcKeySetProperties")); + } + if (expiration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property expiration in model BmcKeySetProperties")); + } + if (privilegeLevel() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privilegeLevel in model BmcKeySetProperties")); + } + if (userList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property userList in model BmcKeySetProperties")); + } else { + userList().forEach(e -> e.validate()); + } + if (userListStatus() != null) { + userListStatus().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BmcKeySetProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java new file mode 100644 index 000000000000..61335b077102 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkInner.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkProvisioningState; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * CloudServicesNetwork represents additional egress information that will be used by associated virtual machines or + * hybrid AKS clusters. + * + *

Upon creation, the additional services that are provided by the platform will be allocated and represented in the + * status of this resource. All resources associated with this cloud services network will be part of the same layer 2 + * (L2) isolation domain. At least one service network must be created but may be reused across many virtual machines + * and/or Hybrid AKS clusters. + */ +@Fluent +public final class CloudServicesNetworkInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * CloudServicesNetworkProperties represents properties of the cloud services network. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private CloudServicesNetworkProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of CloudServicesNetworkInner class. */ + public CloudServicesNetworkInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the CloudServicesNetworkInner object itself. + */ + public CloudServicesNetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: CloudServicesNetworkProperties represents properties of the cloud services + * network. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private CloudServicesNetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public CloudServicesNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CloudServicesNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @return the additionalEgressEndpoints value. + */ + public List additionalEgressEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().additionalEgressEndpoints(); + } + + /** + * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. + * @return the CloudServicesNetworkInner object itself. + */ + public CloudServicesNetworkInner withAdditionalEgressEndpoints(List additionalEgressEndpoints) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudServicesNetworkProperties(); + } + this.innerProperties().withAdditionalEgressEndpoints(additionalEgressEndpoints); + return this; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this cloud services network is + * associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the detailedStatus property: The more detailed status of the cloud services network. + * + * @return the detailedStatus value. + */ + public CloudServicesNetworkDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @return the enableDefaultEgressEndpoints value. + */ + public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().enableDefaultEgressEndpoints(); + } + + /** + * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. + * @return the CloudServicesNetworkInner object itself. + */ + public CloudServicesNetworkInner withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudServicesNetworkProperties(); + } + this.innerProperties().withEnableDefaultEgressEndpoints(enableDefaultEgressEndpoints); + return this; + } + + /** + * Get the enabledEgressEndpoints property: The full list of additional and default egress endpoints that are + * currently enabled. + * + * @return the enabledEgressEndpoints value. + */ + public List enabledEgressEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().enabledEgressEndpoints(); + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this cloud services network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksClustersAssociatedIds(); + } + + /** + * Get the interfaceName property: The name of the interface that will be present in the virtual machine to + * represent this network. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); + } + + /** + * Get the provisioningState property: The provisioning state of the cloud services network. + * + * @return the provisioningState value. + */ + public CloudServicesNetworkProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid AKS + * virtual machines, that are currently using this cloud services network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociatedIds(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model CloudServicesNetworkInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudServicesNetworkInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.java new file mode 100644 index 000000000000..dd1ae8c19ecf --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkPatchProperties.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.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using + * a patch request. + */ +@Fluent +public final class CloudServicesNetworkPatchProperties { + /* + * The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + */ + @JsonProperty(value = "additionalEgressEndpoints") + private List additionalEgressEndpoints; + + /* + * The indicator of whether the platform default endpoints are allowed for the egress traffic. + */ + @JsonProperty(value = "enableDefaultEgressEndpoints") + private CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints; + + /** Creates an instance of CloudServicesNetworkPatchProperties class. */ + public CloudServicesNetworkPatchProperties() { + } + + /** + * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @return the additionalEgressEndpoints value. + */ + public List additionalEgressEndpoints() { + return this.additionalEgressEndpoints; + } + + /** + * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. + * @return the CloudServicesNetworkPatchProperties object itself. + */ + public CloudServicesNetworkPatchProperties withAdditionalEgressEndpoints( + List additionalEgressEndpoints) { + this.additionalEgressEndpoints = additionalEgressEndpoints; + return this; + } + + /** + * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @return the enableDefaultEgressEndpoints value. + */ + public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { + return this.enableDefaultEgressEndpoints; + } + + /** + * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. + * @return the CloudServicesNetworkPatchProperties object itself. + */ + public CloudServicesNetworkPatchProperties withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints) { + this.enableDefaultEgressEndpoints = enableDefaultEgressEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalEgressEndpoints() != null) { + additionalEgressEndpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java new file mode 100644 index 000000000000..41acdc4f53ed --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/CloudServicesNetworkProperties.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkProvisioningState; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CloudServicesNetworkProperties represents properties of the cloud services network. */ +@Fluent +public final class CloudServicesNetworkProperties { + /* + * The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + */ + @JsonProperty(value = "additionalEgressEndpoints") + private List additionalEgressEndpoints; + + /* + * The resource ID of the Network Cloud cluster this cloud services network is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The more detailed status of the cloud services network. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private CloudServicesNetworkDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The indicator of whether the platform default endpoints are allowed for the egress traffic. + */ + @JsonProperty(value = "enableDefaultEgressEndpoints") + private CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints; + + /* + * The full list of additional and default egress endpoints that are currently enabled. + */ + @JsonProperty(value = "enabledEgressEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private List enabledEgressEndpoints; + + /* + * The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network. + */ + @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List hybridAksClustersAssociatedIds; + + /* + * The name of the interface that will be present in the virtual machine to represent this network. + */ + @JsonProperty(value = "interfaceName", access = JsonProperty.Access.WRITE_ONLY) + private String interfaceName; + + /* + * The provisioning state of the cloud services network. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CloudServicesNetworkProvisioningState provisioningState; + + /* + * The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using + * this cloud services network. + */ + @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociatedIds; + + /** Creates an instance of CloudServicesNetworkProperties class. */ + public CloudServicesNetworkProperties() { + } + + /** + * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @return the additionalEgressEndpoints value. + */ + public List additionalEgressEndpoints() { + return this.additionalEgressEndpoints; + } + + /** + * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. + * @return the CloudServicesNetworkProperties object itself. + */ + public CloudServicesNetworkProperties withAdditionalEgressEndpoints( + List additionalEgressEndpoints) { + this.additionalEgressEndpoints = additionalEgressEndpoints; + return this; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this cloud services network is + * associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the detailedStatus property: The more detailed status of the cloud services network. + * + * @return the detailedStatus value. + */ + public CloudServicesNetworkDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @return the enableDefaultEgressEndpoints value. + */ + public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { + return this.enableDefaultEgressEndpoints; + } + + /** + * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. + * @return the CloudServicesNetworkProperties object itself. + */ + public CloudServicesNetworkProperties withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints) { + this.enableDefaultEgressEndpoints = enableDefaultEgressEndpoints; + return this; + } + + /** + * Get the enabledEgressEndpoints property: The full list of additional and default egress endpoints that are + * currently enabled. + * + * @return the enabledEgressEndpoints value. + */ + public List enabledEgressEndpoints() { + return this.enabledEgressEndpoints; + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this cloud services network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.hybridAksClustersAssociatedIds; + } + + /** + * Get the interfaceName property: The name of the interface that will be present in the virtual machine to + * represent this network. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Get the provisioningState property: The provisioning state of the cloud services network. + * + * @return the provisioningState value. + */ + public CloudServicesNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid AKS + * virtual machines, that are currently using this cloud services network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.virtualMachinesAssociatedIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalEgressEndpoints() != null) { + additionalEgressEndpoints().forEach(e -> e.validate()); + } + if (enabledEgressEndpoints() != null) { + enabledEgressEndpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java new file mode 100644 index 000000000000..9e739e92d723 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterInner.java @@ -0,0 +1,533 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; +import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; +import com.azure.resourcemanager.networkcloud.models.ClusterConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Cluster represents the on-premises Network Cloud cluster. */ +@Fluent +public final class ClusterInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster manager associated with the cluster. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * ClusterProperties represents the properties of a cluster. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private ClusterProperties innerProperties = new ClusterProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster manager associated with the cluster. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster manager associated with the cluster. + * + * @param extendedLocation the extendedLocation value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: ClusterProperties represents the properties of a cluster. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @return the aggregatorOrSingleRackDefinition value. + */ + public RackDefinition aggregatorOrSingleRackDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().aggregatorOrSingleRackDefinition(); + } + + /** + * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAggregatorOrSingleRackDefinition(RackDefinition aggregatorOrSingleRackDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAggregatorOrSingleRackDefinition(aggregatorOrSingleRackDefinition); + return this; + } + + /** + * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for + * storing relevant logs. + * + * @return the analyticsWorkspaceId value. + */ + public String analyticsWorkspaceId() { + return this.innerProperties() == null ? null : this.innerProperties().analyticsWorkspaceId(); + } + + /** + * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for + * storing relevant logs. + * + * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withAnalyticsWorkspaceId(analyticsWorkspaceId); + return this; + } + + /** + * Get the availableUpgradeVersions property: The list of cluster runtime version upgrades available for this + * cluster. + * + * @return the availableUpgradeVersions value. + */ + public List availableUpgradeVersions() { + return this.innerProperties() == null ? null : this.innerProperties().availableUpgradeVersions(); + } + + /** + * Get the clusterCapacity property: ClusterCapacity represents various details regarding compute capacity. + * + *

The capacity supported by this cluster. + * + * @return the clusterCapacity value. + */ + public ClusterCapacity clusterCapacity() { + return this.innerProperties() == null ? null : this.innerProperties().clusterCapacity(); + } + + /** + * Get the clusterConnectionStatus property: The latest heartbeat status between the cluster manager and the + * cluster. + * + * @return the clusterConnectionStatus value. + */ + public ClusterConnectionStatus clusterConnectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().clusterConnectionStatus(); + } + + /** + * Get the clusterExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the cluster's control plane location. This extended + * location is used to route the requests of child objects of the cluster that are handled by the platform operator. + * + * @return the clusterExtendedLocation value. + */ + public ExtendedLocation clusterExtendedLocation() { + return this.innerProperties() == null ? null : this.innerProperties().clusterExtendedLocation(); + } + + /** + * Get the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @return the clusterLocation value. + */ + public String clusterLocation() { + return this.innerProperties() == null ? null : this.innerProperties().clusterLocation(); + } + + /** + * Set the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @param clusterLocation the clusterLocation value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterLocation(String clusterLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withClusterLocation(clusterLocation); + return this; + } + + /** + * Get the clusterManagerConnectionStatus property: The latest connectivity status between cluster manager and the + * cluster. + * + * @return the clusterManagerConnectionStatus value. + */ + public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().clusterManagerConnectionStatus(); + } + + /** + * Get the clusterManagerId property: The resource ID of the cluster manager that manages this cluster. This is set + * by the Cluster Manager when the cluster is created. + * + * @return the clusterManagerId value. + */ + public String clusterManagerId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterManagerId(); + } + + /** + * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @return the clusterServicePrincipal value. + */ + public ServicePrincipalInformation clusterServicePrincipal() { + return this.innerProperties() == null ? null : this.innerProperties().clusterServicePrincipal(); + } + + /** + * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @param clusterServicePrincipal the clusterServicePrincipal value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withClusterServicePrincipal(clusterServicePrincipal); + return this; + } + + /** + * Get the clusterType property: The type of rack configuration for the cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.innerProperties() == null ? null : this.innerProperties().clusterType(); + } + + /** + * Set the clusterType property: The type of rack configuration for the cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterType(ClusterType clusterType) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withClusterType(clusterType); + return this; + } + + /** + * Get the clusterVersion property: The current runtime version of the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.innerProperties() == null ? null : this.innerProperties().clusterVersion(); + } + + /** + * Set the clusterVersion property: The current runtime version of the cluster. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterVersion(String clusterVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withClusterVersion(clusterVersion); + return this; + } + + /** + * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @return the computeDeploymentThreshold value. + */ + public ValidationThreshold computeDeploymentThreshold() { + return this.innerProperties() == null ? null : this.innerProperties().computeDeploymentThreshold(); + } + + /** + * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withComputeDeploymentThreshold(computeDeploymentThreshold); + return this; + } + + /** + * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @return the computeRackDefinitions value. + */ + public List computeRackDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().computeRackDefinitions(); + } + + /** + * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @param computeRackDefinitions the computeRackDefinitions value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withComputeRackDefinitions(List computeRackDefinitions) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withComputeRackDefinitions(computeRackDefinitions); + return this; + } + + /** + * Get the detailedStatus property: The current detailed status of the cluster. + * + * @return the detailedStatus value. + */ + public ClusterDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the hybridAksExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the Hybrid AKS control plane location. This extended + * location is used when creating provisioned clusters (Hybrid AKS clusters). + * + * @return the hybridAksExtendedLocation value. + */ + public ExtendedLocation hybridAksExtendedLocation() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksExtendedLocation(); + } + + /** + * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration(); + } + + /** + * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the manualActionCount property: The count of Manual Action Taken (MAT) events that have not been validated. + * + * @return the manualActionCount value. + */ + public Long manualActionCount() { + return this.innerProperties() == null ? null : this.innerProperties().manualActionCount(); + } + + /** + * Get the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.innerProperties() == null ? null : this.innerProperties().networkFabricId(); + } + + /** + * Set the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. + * + * @param networkFabricId the networkFabricId value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withNetworkFabricId(String networkFabricId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withNetworkFabricId(networkFabricId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster. + * + * @return the provisioningState value. + */ + public ClusterProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the supportExpiryDate property: The support end date of the runtime version of the cluster. + * + * @return the supportExpiryDate value. + */ + public String supportExpiryDate() { + return this.innerProperties() == null ? null : this.innerProperties().supportExpiryDate(); + } + + /** + * Get the workloadResourceIds property: The list of workload resource IDs that are hosted within this cluster. + * + * @return the workloadResourceIds value. + */ + public List workloadResourceIds() { + return this.innerProperties() == null ? null : this.innerProperties().workloadResourceIds(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model ClusterInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ClusterInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java new file mode 100644 index 000000000000..0fa8ba7f80e3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerInner.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ClusterAvailableVersion; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ClusterManager represents a control-plane to manage one or more on-premises clusters. */ +@Fluent +public final class ClusterManagerInner extends Resource { + /* + * ClusterManagerProperties represents the properties of a cluster manager. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private ClusterManagerProperties innerProperties = new ClusterManagerProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterManagerInner class. */ + public ClusterManagerInner() { + } + + /** + * Get the innerProperties property: ClusterManagerProperties represents the properties of a cluster manager. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ClusterManagerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ClusterManagerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterManagerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs + * collection. + * + * @return the analyticsWorkspaceId value. + */ + public String analyticsWorkspaceId() { + return this.innerProperties() == null ? null : this.innerProperties().analyticsWorkspaceId(); + } + + /** + * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs + * collection. + * + * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. + * @return the ClusterManagerInner object itself. + */ + public ClusterManagerInner withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterManagerProperties(); + } + this.innerProperties().withAnalyticsWorkspaceId(analyticsWorkspaceId); + return this; + } + + /** + * Get the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The Azure availability zones within the region that + * will be used to support the cluster manager resource. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); + } + + /** + * Set the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The Azure availability zones within the region that + * will be used to support the cluster manager resource. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ClusterManagerInner object itself. + */ + public ClusterManagerInner withAvailabilityZones(List availabilityZones) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterManagerProperties(); + } + this.innerProperties().withAvailabilityZones(availabilityZones); + return this; + } + + /** + * Get the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in + * clusterVersion property of a cluster resource. + * + * @return the clusterVersions value. + */ + public List clusterVersions() { + return this.innerProperties() == null ? null : this.innerProperties().clusterVersions(); + } + + /** + * Get the detailedStatus property: The detailed status that provides additional information about the cluster + * manager. + * + * @return the detailedStatus value. + */ + public ClusterManagerDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with + * the cluster manager. + * + * @return the fabricControllerId value. + */ + public String fabricControllerId() { + return this.innerProperties() == null ? null : this.innerProperties().fabricControllerId(); + } + + /** + * Set the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with + * the cluster manager. + * + * @param fabricControllerId the fabricControllerId value to set. + * @return the ClusterManagerInner object itself. + */ + public ClusterManagerInner withFabricControllerId(String fabricControllerId) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterManagerProperties(); + } + this.innerProperties().withFabricControllerId(fabricControllerId); + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration(); + } + + /** + * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the ClusterManagerInner object itself. + */ + public ClusterManagerInner withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterManagerProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the cluster manager's control plane location. This + * extended location is used when creating cluster and rack manifest resources. + * + * @return the managerExtendedLocation value. + */ + public ExtendedLocation managerExtendedLocation() { + return this.innerProperties() == null ? null : this.innerProperties().managerExtendedLocation(); + } + + /** + * Get the provisioningState property: The provisioning state of the cluster manager. + * + * @return the provisioningState value. + */ + public ClusterManagerProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation + * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the + * cluster manager resource. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Set the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation + * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the + * cluster manager resource. + * + * @param vmSize the vmSize value to set. + * @return the ClusterManagerInner object itself. + */ + public ClusterManagerInner withVmSize(String vmSize) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterManagerProperties(); + } + this.innerProperties().withVmSize(vmSize); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ClusterManagerInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterManagerInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java new file mode 100644 index 000000000000..663cd628a947 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterManagerProperties.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ClusterAvailableVersion; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterManagerProperties represents the properties of a cluster manager. */ +@Fluent +public final class ClusterManagerProperties { + /* + * The resource ID of the Log Analytics workspace that is used for the logs collection. + */ + @JsonProperty(value = "analyticsWorkspaceId") + private String analyticsWorkspaceId; + + /* + * Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed + * in a future version. The Azure availability zones within the region that will be used to support the cluster + * manager resource. + */ + @JsonProperty(value = "availabilityZones") + private List availabilityZones; + + /* + * The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a + * cluster resource. + */ + @JsonProperty(value = "clusterVersions", access = JsonProperty.Access.WRITE_ONLY) + private List clusterVersions; + + /* + * The detailed status that provides additional information about the cluster manager. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private ClusterManagerDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The resource ID of the fabric controller that has one to one mapping with the cluster manager. + */ + @JsonProperty(value = "fabricControllerId", required = true) + private String fabricControllerId; + + /* + * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. + * + * The configuration of the managed resource group associated with the resource. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location (custom location) that represents the cluster manager's control plane location. This + * extended location is used when creating cluster and rack manifest resources. + */ + @JsonProperty(value = "managerExtendedLocation", access = JsonProperty.Access.WRITE_ONLY) + private ExtendedLocation managerExtendedLocation; + + /* + * The provisioning state of the cluster manager. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterManagerProvisioningState provisioningState; + + /* + * Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed + * in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** Creates an instance of ClusterManagerProperties class. */ + public ClusterManagerProperties() { + } + + /** + * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs + * collection. + * + * @return the analyticsWorkspaceId value. + */ + public String analyticsWorkspaceId() { + return this.analyticsWorkspaceId; + } + + /** + * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs + * collection. + * + * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. + * @return the ClusterManagerProperties object itself. + */ + public ClusterManagerProperties withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + this.analyticsWorkspaceId = analyticsWorkspaceId; + return this; + } + + /** + * Get the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The Azure availability zones within the region that + * will be used to support the cluster manager resource. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The Azure availability zones within the region that + * will be used to support the cluster manager resource. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ClusterManagerProperties object itself. + */ + public ClusterManagerProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in + * clusterVersion property of a cluster resource. + * + * @return the clusterVersions value. + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Get the detailedStatus property: The detailed status that provides additional information about the cluster + * manager. + * + * @return the detailedStatus value. + */ + public ClusterManagerDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with + * the cluster manager. + * + * @return the fabricControllerId value. + */ + public String fabricControllerId() { + return this.fabricControllerId; + } + + /** + * Set the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with + * the cluster manager. + * + * @param fabricControllerId the fabricControllerId value to set. + * @return the ClusterManagerProperties object itself. + */ + public ClusterManagerProperties withFabricControllerId(String fabricControllerId) { + this.fabricControllerId = fabricControllerId; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the ClusterManagerProperties object itself. + */ + public ClusterManagerProperties withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the cluster manager's control plane location. This + * extended location is used when creating cluster and rack manifest resources. + * + * @return the managerExtendedLocation value. + */ + public ExtendedLocation managerExtendedLocation() { + return this.managerExtendedLocation; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster manager. + * + * @return the provisioningState value. + */ + public ClusterManagerProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation + * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the + * cluster manager resource. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation + * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the + * cluster manager resource. + * + * @param vmSize the vmSize value to set. + * @return the ClusterManagerProperties object itself. + */ + public ClusterManagerProperties withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterVersions() != null) { + clusterVersions().forEach(e -> e.validate()); + } + if (fabricControllerId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fabricControllerId in model ClusterManagerProperties")); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (managerExtendedLocation() != null) { + managerExtendedLocation().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterManagerProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java new file mode 100644 index 000000000000..99cbc80a18f1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationInner.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. */ +@Fluent +public final class ClusterMetricsConfigurationInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private ClusterMetricsConfigurationProperties innerProperties = new ClusterMetricsConfigurationProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterMetricsConfigurationInner class. */ + public ClusterMetricsConfigurationInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the ClusterMetricsConfigurationInner object itself. + */ + public ClusterMetricsConfigurationInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: ClusterMetricsConfigurationProperties represents the properties of metrics + * configuration for the cluster. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ClusterMetricsConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ClusterMetricsConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterMetricsConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @return the collectionInterval value. + */ + public long collectionInterval() { + return this.innerProperties() == null ? 0L : this.innerProperties().collectionInterval(); + } + + /** + * Set the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @param collectionInterval the collectionInterval value to set. + * @return the ClusterMetricsConfigurationInner object itself. + */ + public ClusterMetricsConfigurationInner withCollectionInterval(long collectionInterval) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterMetricsConfigurationProperties(); + } + this.innerProperties().withCollectionInterval(collectionInterval); + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the metrics configuration. + * + * @return the detailedStatus value. + */ + public ClusterMetricsConfigurationDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the + * moment. + * + * @return the disabledMetrics value. + */ + public List disabledMetrics() { + return this.innerProperties() == null ? null : this.innerProperties().disabledMetrics(); + } + + /** + * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @return the enabledMetrics value. + */ + public List enabledMetrics() { + return this.innerProperties() == null ? null : this.innerProperties().enabledMetrics(); + } + + /** + * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @param enabledMetrics the enabledMetrics value to set. + * @return the ClusterMetricsConfigurationInner object itself. + */ + public ClusterMetricsConfigurationInner withEnabledMetrics(List enabledMetrics) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterMetricsConfigurationProperties(); + } + this.innerProperties().withEnabledMetrics(enabledMetrics); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the metrics configuration. + * + * @return the provisioningState value. + */ + public ClusterMetricsConfigurationProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model ClusterMetricsConfigurationInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ClusterMetricsConfigurationInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterMetricsConfigurationInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java new file mode 100644 index 000000000000..1c976e2ae0bc --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationPatchProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * ClusterMetricsConfigurationPatchProperties represents the properties of metrics configuration for the cluster for + * patching. + */ +@Fluent +public final class ClusterMetricsConfigurationPatchProperties { + /* + * The interval in minutes by which metrics will be collected. + */ + @JsonProperty(value = "collectionInterval") + private Long collectionInterval; + + /* + * The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + */ + @JsonProperty(value = "enabledMetrics") + private List enabledMetrics; + + /** Creates an instance of ClusterMetricsConfigurationPatchProperties class. */ + public ClusterMetricsConfigurationPatchProperties() { + } + + /** + * Get the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @return the collectionInterval value. + */ + public Long collectionInterval() { + return this.collectionInterval; + } + + /** + * Set the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @param collectionInterval the collectionInterval value to set. + * @return the ClusterMetricsConfigurationPatchProperties object itself. + */ + public ClusterMetricsConfigurationPatchProperties withCollectionInterval(Long collectionInterval) { + this.collectionInterval = collectionInterval; + return this; + } + + /** + * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @return the enabledMetrics value. + */ + public List enabledMetrics() { + return this.enabledMetrics; + } + + /** + * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @param enabledMetrics the enabledMetrics value to set. + * @return the ClusterMetricsConfigurationPatchProperties object itself. + */ + public ClusterMetricsConfigurationPatchProperties withEnabledMetrics(List enabledMetrics) { + this.enabledMetrics = enabledMetrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java new file mode 100644 index 000000000000..f818eb325dce --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterMetricsConfigurationProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. */ +@Fluent +public final class ClusterMetricsConfigurationProperties { + /* + * The interval in minutes by which metrics will be collected. + */ + @JsonProperty(value = "collectionInterval", required = true) + private long collectionInterval; + + /* + * The more detailed status of the metrics configuration. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private ClusterMetricsConfigurationDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The list of metrics that are available for the cluster but disabled at the moment. + */ + @JsonProperty(value = "disabledMetrics", access = JsonProperty.Access.WRITE_ONLY) + private List disabledMetrics; + + /* + * The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + */ + @JsonProperty(value = "enabledMetrics") + private List enabledMetrics; + + /* + * The provisioning state of the metrics configuration. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterMetricsConfigurationProvisioningState provisioningState; + + /** Creates an instance of ClusterMetricsConfigurationProperties class. */ + public ClusterMetricsConfigurationProperties() { + } + + /** + * Get the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @return the collectionInterval value. + */ + public long collectionInterval() { + return this.collectionInterval; + } + + /** + * Set the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @param collectionInterval the collectionInterval value to set. + * @return the ClusterMetricsConfigurationProperties object itself. + */ + public ClusterMetricsConfigurationProperties withCollectionInterval(long collectionInterval) { + this.collectionInterval = collectionInterval; + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the metrics configuration. + * + * @return the detailedStatus value. + */ + public ClusterMetricsConfigurationDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the + * moment. + * + * @return the disabledMetrics value. + */ + public List disabledMetrics() { + return this.disabledMetrics; + } + + /** + * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @return the enabledMetrics value. + */ + public List enabledMetrics() { + return this.enabledMetrics; + } + + /** + * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @param enabledMetrics the enabledMetrics value to set. + * @return the ClusterMetricsConfigurationProperties object itself. + */ + public ClusterMetricsConfigurationProperties withEnabledMetrics(List enabledMetrics) { + this.enabledMetrics = enabledMetrics; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the metrics configuration. + * + * @return the provisioningState value. + */ + public ClusterMetricsConfigurationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java new file mode 100644 index 000000000000..510b29447e91 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterPatchProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterPatchProperties represents the properties of the cluster for patching. */ +@Fluent +public final class ClusterPatchProperties { + /* + * RackDefinition represents details regarding the rack. + * + * The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + */ + @JsonProperty(value = "aggregatorOrSingleRackDefinition") + private RackDefinition aggregatorOrSingleRackDefinition; + + /* + * The customer-provided location information to identify where the cluster resides. + */ + @JsonProperty(value = "clusterLocation") + private String clusterLocation; + + /* + * ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc + * Appliance installation. + * + * The service principal to be used by the cluster during Arc Appliance installation. + */ + @JsonProperty(value = "clusterServicePrincipal") + private ServicePrincipalInformation clusterServicePrincipal; + + /* + * ValidationThreshold indicates allowed machine and node hardware and deployment failures. + * + * The validation threshold indicating the allowable failures of compute machines during environment validation and + * deployment. + */ + @JsonProperty(value = "computeDeploymentThreshold") + private ValidationThreshold computeDeploymentThreshold; + + /* + * The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + */ + @JsonProperty(value = "computeRackDefinitions") + private List computeRackDefinitions; + + /** Creates an instance of ClusterPatchProperties class. */ + public ClusterPatchProperties() { + } + + /** + * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @return the aggregatorOrSingleRackDefinition value. + */ + public RackDefinition aggregatorOrSingleRackDefinition() { + return this.aggregatorOrSingleRackDefinition; + } + + /** + * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withAggregatorOrSingleRackDefinition( + RackDefinition aggregatorOrSingleRackDefinition) { + this.aggregatorOrSingleRackDefinition = aggregatorOrSingleRackDefinition; + return this; + } + + /** + * Get the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @return the clusterLocation value. + */ + public String clusterLocation() { + return this.clusterLocation; + } + + /** + * Set the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @param clusterLocation the clusterLocation value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withClusterLocation(String clusterLocation) { + this.clusterLocation = clusterLocation; + return this; + } + + /** + * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @return the clusterServicePrincipal value. + */ + public ServicePrincipalInformation clusterServicePrincipal() { + return this.clusterServicePrincipal; + } + + /** + * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @param clusterServicePrincipal the clusterServicePrincipal value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal) { + this.clusterServicePrincipal = clusterServicePrincipal; + return this; + } + + /** + * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @return the computeDeploymentThreshold value. + */ + public ValidationThreshold computeDeploymentThreshold() { + return this.computeDeploymentThreshold; + } + + /** + * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) { + this.computeDeploymentThreshold = computeDeploymentThreshold; + return this; + } + + /** + * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @return the computeRackDefinitions value. + */ + public List computeRackDefinitions() { + return this.computeRackDefinitions; + } + + /** + * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @param computeRackDefinitions the computeRackDefinitions value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withComputeRackDefinitions(List computeRackDefinitions) { + this.computeRackDefinitions = computeRackDefinitions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregatorOrSingleRackDefinition() != null) { + aggregatorOrSingleRackDefinition().validate(); + } + if (clusterServicePrincipal() != null) { + clusterServicePrincipal().validate(); + } + if (computeDeploymentThreshold() != null) { + computeDeploymentThreshold().validate(); + } + if (computeRackDefinitions() != null) { + computeRackDefinitions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java new file mode 100644 index 000000000000..d748eaccd97d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ClusterProperties.java @@ -0,0 +1,619 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; +import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; +import com.azure.resourcemanager.networkcloud.models.ClusterConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterProperties represents the properties of a cluster. */ +@Fluent +public final class ClusterProperties { + /* + * RackDefinition represents details regarding the rack. + * + * The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + */ + @JsonProperty(value = "aggregatorOrSingleRackDefinition", required = true) + private RackDefinition aggregatorOrSingleRackDefinition; + + /* + * The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + */ + @JsonProperty(value = "analyticsWorkspaceId", required = true) + private String analyticsWorkspaceId; + + /* + * The list of cluster runtime version upgrades available for this cluster. + */ + @JsonProperty(value = "availableUpgradeVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableUpgradeVersions; + + /* + * ClusterCapacity represents various details regarding compute capacity. + * + * The capacity supported by this cluster. + */ + @JsonProperty(value = "clusterCapacity", access = JsonProperty.Access.WRITE_ONLY) + private ClusterCapacity clusterCapacity; + + /* + * The latest heartbeat status between the cluster manager and the cluster. + */ + @JsonProperty(value = "clusterConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ClusterConnectionStatus clusterConnectionStatus; + + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location (custom location) that represents the cluster's control plane location. This extended + * location is used to route the requests of child objects of the cluster that are handled by the platform + * operator. + */ + @JsonProperty(value = "clusterExtendedLocation", access = JsonProperty.Access.WRITE_ONLY) + private ExtendedLocation clusterExtendedLocation; + + /* + * The customer-provided location information to identify where the cluster resides. + */ + @JsonProperty(value = "clusterLocation") + private String clusterLocation; + + /* + * The latest connectivity status between cluster manager and the cluster. + */ + @JsonProperty(value = "clusterManagerConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private ClusterManagerConnectionStatus clusterManagerConnectionStatus; + + /* + * The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the + * cluster is created. + */ + @JsonProperty(value = "clusterManagerId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterManagerId; + + /* + * ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc + * Appliance installation. + * + * The service principal to be used by the cluster during Arc Appliance installation. + */ + @JsonProperty(value = "clusterServicePrincipal") + private ServicePrincipalInformation clusterServicePrincipal; + + /* + * The type of rack configuration for the cluster. + */ + @JsonProperty(value = "clusterType", required = true) + private ClusterType clusterType; + + /* + * The current runtime version of the cluster. + */ + @JsonProperty(value = "clusterVersion", required = true) + private String clusterVersion; + + /* + * ValidationThreshold indicates allowed machine and node hardware and deployment failures. + * + * The validation threshold indicating the allowable failures of compute machines during environment validation and + * deployment. + */ + @JsonProperty(value = "computeDeploymentThreshold") + private ValidationThreshold computeDeploymentThreshold; + + /* + * The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + */ + @JsonProperty(value = "computeRackDefinitions") + private List computeRackDefinitions; + + /* + * The current detailed status of the cluster. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private ClusterDetailedStatus detailedStatus; + + /* + * The descriptive message about the detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location (custom location) that represents the Hybrid AKS control plane location. This extended + * location is used when creating provisioned clusters (Hybrid AKS clusters). + */ + @JsonProperty(value = "hybridAksExtendedLocation", access = JsonProperty.Access.WRITE_ONLY) + private ExtendedLocation hybridAksExtendedLocation; + + /* + * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. + * + * The configuration of the managed resource group associated with the resource. + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedResourceGroupConfiguration managedResourceGroupConfiguration; + + /* + * The count of Manual Action Taken (MAT) events that have not been validated. + */ + @JsonProperty(value = "manualActionCount", access = JsonProperty.Access.WRITE_ONLY) + private Long manualActionCount; + + /* + * The resource ID of the Network Fabric associated with the cluster. + */ + @JsonProperty(value = "networkFabricId", required = true) + private String networkFabricId; + + /* + * The provisioning state of the cluster. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterProvisioningState provisioningState; + + /* + * The support end date of the runtime version of the cluster. + */ + @JsonProperty(value = "supportExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private String supportExpiryDate; + + /* + * The list of workload resource IDs that are hosted within this cluster. + */ + @JsonProperty(value = "workloadResourceIds", access = JsonProperty.Access.WRITE_ONLY) + private List workloadResourceIds; + + /** Creates an instance of ClusterProperties class. */ + public ClusterProperties() { + } + + /** + * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @return the aggregatorOrSingleRackDefinition value. + */ + public RackDefinition aggregatorOrSingleRackDefinition() { + return this.aggregatorOrSingleRackDefinition; + } + + /** + * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAggregatorOrSingleRackDefinition(RackDefinition aggregatorOrSingleRackDefinition) { + this.aggregatorOrSingleRackDefinition = aggregatorOrSingleRackDefinition; + return this; + } + + /** + * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for + * storing relevant logs. + * + * @return the analyticsWorkspaceId value. + */ + public String analyticsWorkspaceId() { + return this.analyticsWorkspaceId; + } + + /** + * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for + * storing relevant logs. + * + * @param analyticsWorkspaceId the analyticsWorkspaceId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + this.analyticsWorkspaceId = analyticsWorkspaceId; + return this; + } + + /** + * Get the availableUpgradeVersions property: The list of cluster runtime version upgrades available for this + * cluster. + * + * @return the availableUpgradeVersions value. + */ + public List availableUpgradeVersions() { + return this.availableUpgradeVersions; + } + + /** + * Get the clusterCapacity property: ClusterCapacity represents various details regarding compute capacity. + * + *

The capacity supported by this cluster. + * + * @return the clusterCapacity value. + */ + public ClusterCapacity clusterCapacity() { + return this.clusterCapacity; + } + + /** + * Get the clusterConnectionStatus property: The latest heartbeat status between the cluster manager and the + * cluster. + * + * @return the clusterConnectionStatus value. + */ + public ClusterConnectionStatus clusterConnectionStatus() { + return this.clusterConnectionStatus; + } + + /** + * Get the clusterExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the cluster's control plane location. This extended + * location is used to route the requests of child objects of the cluster that are handled by the platform operator. + * + * @return the clusterExtendedLocation value. + */ + public ExtendedLocation clusterExtendedLocation() { + return this.clusterExtendedLocation; + } + + /** + * Get the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @return the clusterLocation value. + */ + public String clusterLocation() { + return this.clusterLocation; + } + + /** + * Set the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @param clusterLocation the clusterLocation value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withClusterLocation(String clusterLocation) { + this.clusterLocation = clusterLocation; + return this; + } + + /** + * Get the clusterManagerConnectionStatus property: The latest connectivity status between cluster manager and the + * cluster. + * + * @return the clusterManagerConnectionStatus value. + */ + public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { + return this.clusterManagerConnectionStatus; + } + + /** + * Get the clusterManagerId property: The resource ID of the cluster manager that manages this cluster. This is set + * by the Cluster Manager when the cluster is created. + * + * @return the clusterManagerId value. + */ + public String clusterManagerId() { + return this.clusterManagerId; + } + + /** + * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @return the clusterServicePrincipal value. + */ + public ServicePrincipalInformation clusterServicePrincipal() { + return this.clusterServicePrincipal; + } + + /** + * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @param clusterServicePrincipal the clusterServicePrincipal value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal) { + this.clusterServicePrincipal = clusterServicePrincipal; + return this; + } + + /** + * Get the clusterType property: The type of rack configuration for the cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: The type of rack configuration for the cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the clusterVersion property: The current runtime version of the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the clusterVersion property: The current runtime version of the cluster. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @return the computeDeploymentThreshold value. + */ + public ValidationThreshold computeDeploymentThreshold() { + return this.computeDeploymentThreshold; + } + + /** + * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) { + this.computeDeploymentThreshold = computeDeploymentThreshold; + return this; + } + + /** + * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @return the computeRackDefinitions value. + */ + public List computeRackDefinitions() { + return this.computeRackDefinitions; + } + + /** + * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @param computeRackDefinitions the computeRackDefinitions value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withComputeRackDefinitions(List computeRackDefinitions) { + this.computeRackDefinitions = computeRackDefinitions; + return this; + } + + /** + * Get the detailedStatus property: The current detailed status of the cluster. + * + * @return the detailedStatus value. + */ + public ClusterDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the hybridAksExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the Hybrid AKS control plane location. This extended + * location is used when creating provisioned clusters (Hybrid AKS clusters). + * + * @return the hybridAksExtendedLocation value. + */ + public ExtendedLocation hybridAksExtendedLocation() { + return this.hybridAksExtendedLocation; + } + + /** + * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the manualActionCount property: The count of Manual Action Taken (MAT) events that have not been validated. + * + * @return the manualActionCount value. + */ + public Long manualActionCount() { + return this.manualActionCount; + } + + /** + * Get the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. + * + * @return the networkFabricId value. + */ + public String networkFabricId() { + return this.networkFabricId; + } + + /** + * Set the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. + * + * @param networkFabricId the networkFabricId value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withNetworkFabricId(String networkFabricId) { + this.networkFabricId = networkFabricId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster. + * + * @return the provisioningState value. + */ + public ClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the supportExpiryDate property: The support end date of the runtime version of the cluster. + * + * @return the supportExpiryDate value. + */ + public String supportExpiryDate() { + return this.supportExpiryDate; + } + + /** + * Get the workloadResourceIds property: The list of workload resource IDs that are hosted within this cluster. + * + * @return the workloadResourceIds value. + */ + public List workloadResourceIds() { + return this.workloadResourceIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aggregatorOrSingleRackDefinition() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property aggregatorOrSingleRackDefinition in model ClusterProperties")); + } else { + aggregatorOrSingleRackDefinition().validate(); + } + if (analyticsWorkspaceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property analyticsWorkspaceId in model ClusterProperties")); + } + if (availableUpgradeVersions() != null) { + availableUpgradeVersions().forEach(e -> e.validate()); + } + if (clusterCapacity() != null) { + clusterCapacity().validate(); + } + if (clusterExtendedLocation() != null) { + clusterExtendedLocation().validate(); + } + if (clusterServicePrincipal() != null) { + clusterServicePrincipal().validate(); + } + if (clusterType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property clusterType in model ClusterProperties")); + } + if (clusterVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterVersion in model ClusterProperties")); + } + if (computeDeploymentThreshold() != null) { + computeDeploymentThreshold().validate(); + } + if (computeRackDefinitions() != null) { + computeRackDefinitions().forEach(e -> e.validate()); + } + if (hybridAksExtendedLocation() != null) { + hybridAksExtendedLocation().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (networkFabricId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkFabricId in model ClusterProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java new file mode 100644 index 000000000000..09ab08cee554 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleInner.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ConsoleDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.ConsoleProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Console represents the console of an on-premises Network Cloud virtual machine. */ +@Fluent +public final class ConsoleInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster manager associated with the cluster this virtual machine is created on. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * ConsoleProperties represents the properties of the virtual machine console. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private ConsoleProperties innerProperties = new ConsoleProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ConsoleInner class. */ + public ConsoleInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster manager associated with the cluster this virtual machine is created on. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster manager associated with the cluster this virtual machine is created on. + * + * @param extendedLocation the extendedLocation value to set. + * @return the ConsoleInner object itself. + */ + public ConsoleInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: ConsoleProperties represents the properties of the virtual machine console. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ConsoleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ConsoleInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ConsoleInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the console. + * + * @return the detailedStatus value. + */ + public ConsoleDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the enabled property: The indicator of whether the console access is enabled. + * + * @return the enabled value. + */ + public ConsoleEnabled enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: The indicator of whether the console access is enabled. + * + * @param enabled the enabled value to set. + * @return the ConsoleInner object itself. + */ + public ConsoleInner withEnabled(ConsoleEnabled enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsoleProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the expiration property: The date and time after which the key will be disallowed access. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: The date and time after which the key will be disallowed access. + * + * @param expiration the expiration value to set. + * @return the ConsoleInner object itself. + */ + public ConsoleInner withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsoleProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Get the privateLinkServiceId property: The resource ID of the private link service that is used to provide + * virtual machine console access. + * + * @return the privateLinkServiceId value. + */ + public String privateLinkServiceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceId(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual machine console. + * + * @return the provisioningState value. + */ + public ConsoleProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @return the sshPublicKey value. + */ + public SshPublicKey sshPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().sshPublicKey(); + } + + /** + * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the ConsoleInner object itself. + */ + public ConsoleInner withSshPublicKey(SshPublicKey sshPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsoleProperties(); + } + this.innerProperties().withSshPublicKey(sshPublicKey); + return this; + } + + /** + * Get the virtualMachineAccessId property: The unique identifier for the virtual machine that is used to access the + * console. + * + * @return the virtualMachineAccessId value. + */ + public String virtualMachineAccessId() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachineAccessId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model ConsoleInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model ConsoleInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConsoleInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java new file mode 100644 index 000000000000..fbcb8af319fd --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsolePatchProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** ConsolePatchProperties represents the properties of the virtual machine console that can be patched. */ +@Fluent +public final class ConsolePatchProperties { + /* + * The credentials used to login to the image repository that has access to the specified image. + */ + @JsonProperty(value = "enabled") + private ConsoleEnabled enabled; + + /* + * The date and time after which the key will be disallowed access. + */ + @JsonProperty(value = "expiration") + private OffsetDateTime expiration; + + /* + * SshPublicKey represents the public key used to authenticate with the virtual machine through SSH. + * + * The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH + * private key for logging in. + */ + @JsonProperty(value = "sshPublicKey") + private SshPublicKey sshPublicKey; + + /** Creates an instance of ConsolePatchProperties class. */ + public ConsolePatchProperties() { + } + + /** + * Get the enabled property: The credentials used to login to the image repository that has access to the specified + * image. + * + * @return the enabled value. + */ + public ConsoleEnabled enabled() { + return this.enabled; + } + + /** + * Set the enabled property: The credentials used to login to the image repository that has access to the specified + * image. + * + * @param enabled the enabled value to set. + * @return the ConsolePatchProperties object itself. + */ + public ConsolePatchProperties withEnabled(ConsoleEnabled enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the expiration property: The date and time after which the key will be disallowed access. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The date and time after which the key will be disallowed access. + * + * @param expiration the expiration value to set. + * @return the ConsolePatchProperties object itself. + */ + public ConsolePatchProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @return the sshPublicKey value. + */ + public SshPublicKey sshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the ConsolePatchProperties object itself. + */ + public ConsolePatchProperties withSshPublicKey(SshPublicKey sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sshPublicKey() != null) { + sshPublicKey().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java new file mode 100644 index 000000000000..7c959282acb0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/ConsoleProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ConsoleDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.ConsoleProvisioningState; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** ConsoleProperties represents the properties of the virtual machine console. */ +@Fluent +public final class ConsoleProperties { + /* + * The more detailed status of the console. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private ConsoleDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The indicator of whether the console access is enabled. + */ + @JsonProperty(value = "enabled", required = true) + private ConsoleEnabled enabled; + + /* + * The date and time after which the key will be disallowed access. + */ + @JsonProperty(value = "expiration") + private OffsetDateTime expiration; + + /* + * The resource ID of the private link service that is used to provide virtual machine console access. + */ + @JsonProperty(value = "privateLinkServiceId", access = JsonProperty.Access.WRITE_ONLY) + private String privateLinkServiceId; + + /* + * The provisioning state of the virtual machine console. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ConsoleProvisioningState provisioningState; + + /* + * SshPublicKey represents the public key used to authenticate with the virtual machine through SSH. + * + * The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH + * private key for logging in. + */ + @JsonProperty(value = "sshPublicKey", required = true) + private SshPublicKey sshPublicKey; + + /* + * The unique identifier for the virtual machine that is used to access the console. + */ + @JsonProperty(value = "virtualMachineAccessId", access = JsonProperty.Access.WRITE_ONLY) + private String virtualMachineAccessId; + + /** Creates an instance of ConsoleProperties class. */ + public ConsoleProperties() { + } + + /** + * Get the detailedStatus property: The more detailed status of the console. + * + * @return the detailedStatus value. + */ + public ConsoleDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the enabled property: The indicator of whether the console access is enabled. + * + * @return the enabled value. + */ + public ConsoleEnabled enabled() { + return this.enabled; + } + + /** + * Set the enabled property: The indicator of whether the console access is enabled. + * + * @param enabled the enabled value to set. + * @return the ConsoleProperties object itself. + */ + public ConsoleProperties withEnabled(ConsoleEnabled enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the expiration property: The date and time after which the key will be disallowed access. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: The date and time after which the key will be disallowed access. + * + * @param expiration the expiration value to set. + * @return the ConsoleProperties object itself. + */ + public ConsoleProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get the privateLinkServiceId property: The resource ID of the private link service that is used to provide + * virtual machine console access. + * + * @return the privateLinkServiceId value. + */ + public String privateLinkServiceId() { + return this.privateLinkServiceId; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual machine console. + * + * @return the provisioningState value. + */ + public ConsoleProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @return the sshPublicKey value. + */ + public SshPublicKey sshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the ConsoleProperties object itself. + */ + public ConsoleProperties withSshPublicKey(SshPublicKey sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * Get the virtualMachineAccessId property: The unique identifier for the virtual machine that is used to access the + * console. + * + * @return the virtualMachineAccessId value. + */ + public String virtualMachineAccessId() { + return this.virtualMachineAccessId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enabled() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property enabled in model ConsoleProperties")); + } + if (sshPublicKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sshPublicKey in model ConsoleProperties")); + } else { + sshPublicKey().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConsoleProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/DefaultCniNetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/DefaultCniNetworkInner.java new file mode 100644 index 000000000000..a01e118a41bb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/DefaultCniNetworkInner.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.BgpPeer; +import com.azure.resourcemanager.networkcloud.models.CniBgpConfiguration; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * DefaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created in support of + * a Hybrid AKS Cluster. + */ +@Fluent +public final class DefaultCniNetworkInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * DefaultCniNetworkProperties represents properties of the default CNI network. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private DefaultCniNetworkProperties innerProperties = new DefaultCniNetworkProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of DefaultCniNetworkInner class. */ + public DefaultCniNetworkInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: DefaultCniNetworkProperties represents properties of the default CNI network. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private DefaultCniNetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public DefaultCniNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DefaultCniNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this default CNI network is associated + * with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the cniAsNumber property: The autonomous system number that the fabric expects to peer with, derived from the + * associated L3 isolation domain. + * + * @return the cniAsNumber value. + */ + public Long cniAsNumber() { + return this.innerProperties() == null ? null : this.innerProperties().cniAsNumber(); + } + + /** + * Get the cniBgpConfiguration property: CniBgpConfiguration represents the Calico BGP configuration. + * + *

The Calico BGP configuration. + * + * @return the cniBgpConfiguration value. + */ + public CniBgpConfiguration cniBgpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().cniBgpConfiguration(); + } + + /** + * Set the cniBgpConfiguration property: CniBgpConfiguration represents the Calico BGP configuration. + * + *

The Calico BGP configuration. + * + * @param cniBgpConfiguration the cniBgpConfiguration value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withCniBgpConfiguration(CniBgpConfiguration cniBgpConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultCniNetworkProperties(); + } + this.innerProperties().withCniBgpConfiguration(cniBgpConfiguration); + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the default CNI network. + * + * @return the detailedStatus value. + */ + public DefaultCniNetworkDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the fabricBgpPeers property: The L3 isolation fabric BGP peering connectivity information necessary for BGP + * peering the Hybrid AKS Cluster with the switch fabric. + * + * @return the fabricBgpPeers value. + */ + public List fabricBgpPeers() { + return this.innerProperties() == null ? null : this.innerProperties().fabricBgpPeers(); + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource ID(s) that are + * associated with this default CNI network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksClustersAssociatedIds(); + } + + /** + * Get the interfaceName property: The name of the interface that will be present in the virtual machine to + * represent this network. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); + } + + /** + * Get the ipAllocationType property: The type of the IP address allocation. + * + * @return the ipAllocationType value. + */ + public IpAllocationType ipAllocationType() { + return this.innerProperties() == null ? null : this.innerProperties().ipAllocationType(); + } + + /** + * Set the ipAllocationType property: The type of the IP address allocation. + * + * @param ipAllocationType the ipAllocationType value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withIpAllocationType(IpAllocationType ipAllocationType) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultCniNetworkProperties(); + } + this.innerProperties().withIpAllocationType(ipAllocationType); + return this; + } + + /** + * Get the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV4 or DualStack. + * + * @return the ipv4ConnectedPrefix value. + */ + public String ipv4ConnectedPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipv4ConnectedPrefix(); + } + + /** + * Set the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV4 or DualStack. + * + * @param ipv4ConnectedPrefix the ipv4ConnectedPrefix value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultCniNetworkProperties(); + } + this.innerProperties().withIpv4ConnectedPrefix(ipv4ConnectedPrefix); + return this; + } + + /** + * Get the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV6 or DualStack. + * + * @return the ipv6ConnectedPrefix value. + */ + public String ipv6ConnectedPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipv6ConnectedPrefix(); + } + + /** + * Set the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV6 or DualStack. + * + * @param ipv6ConnectedPrefix the ipv6ConnectedPrefix value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultCniNetworkProperties(); + } + this.innerProperties().withIpv6ConnectedPrefix(ipv6ConnectedPrefix); + return this; + } + + /** + * Get the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @return the l3IsolationDomainId value. + */ + public String l3IsolationDomainId() { + return this.innerProperties() == null ? null : this.innerProperties().l3IsolationDomainId(); + } + + /** + * Set the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @param l3IsolationDomainId the l3IsolationDomainId value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withL3IsolationDomainId(String l3IsolationDomainId) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultCniNetworkProperties(); + } + this.innerProperties().withL3IsolationDomainId(l3IsolationDomainId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the default CNI network. + * + * @return the provisioningState value. + */ + public DefaultCniNetworkProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @return the vlan value. + */ + public long vlan() { + return this.innerProperties() == null ? 0L : this.innerProperties().vlan(); + } + + /** + * Set the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @param vlan the vlan value to set. + * @return the DefaultCniNetworkInner object itself. + */ + public DefaultCniNetworkInner withVlan(long vlan) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultCniNetworkProperties(); + } + this.innerProperties().withVlan(vlan); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model DefaultCniNetworkInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model DefaultCniNetworkInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DefaultCniNetworkInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/DefaultCniNetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/DefaultCniNetworkProperties.java new file mode 100644 index 000000000000..0fc7dc9ac8c2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/DefaultCniNetworkProperties.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.BgpPeer; +import com.azure.resourcemanager.networkcloud.models.CniBgpConfiguration; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkProvisioningState; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DefaultCniNetworkProperties represents properties of the default CNI network. */ +@Fluent +public final class DefaultCniNetworkProperties { + /* + * The resource ID of the Network Cloud cluster this default CNI network is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The autonomous system number that the fabric expects to peer with, derived from the associated L3 isolation + * domain. + */ + @JsonProperty(value = "cniAsNumber", access = JsonProperty.Access.WRITE_ONLY) + private Long cniAsNumber; + + /* + * CniBgpConfiguration represents the Calico BGP configuration. + * + * The Calico BGP configuration. + */ + @JsonProperty(value = "cniBgpConfiguration") + private CniBgpConfiguration cniBgpConfiguration; + + /* + * The more detailed status of the default CNI network. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private DefaultCniNetworkDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The L3 isolation fabric BGP peering connectivity information necessary for BGP peering the Hybrid AKS Cluster + * with the switch fabric. + */ + @JsonProperty(value = "fabricBgpPeers", access = JsonProperty.Access.WRITE_ONLY) + private List fabricBgpPeers; + + /* + * The list of Hybrid AKS cluster resource ID(s) that are associated with this default CNI network. + */ + @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List hybridAksClustersAssociatedIds; + + /* + * The name of the interface that will be present in the virtual machine to represent this network. + */ + @JsonProperty(value = "interfaceName", access = JsonProperty.Access.WRITE_ONLY) + private String interfaceName; + + /* + * The type of the IP address allocation. + */ + @JsonProperty(value = "ipAllocationType") + private IpAllocationType ipAllocationType; + + /* + * The IPV4 prefix (CIDR) assigned to this default CNI network. It is required when the IP allocation type + * is IPV4 or DualStack. + */ + @JsonProperty(value = "ipv4ConnectedPrefix") + private String ipv4ConnectedPrefix; + + /* + * The IPV6 prefix (CIDR) assigned to this default CNI network. It is required when the IP allocation type + * is IPV6 or DualStack. + */ + @JsonProperty(value = "ipv6ConnectedPrefix") + private String ipv6ConnectedPrefix; + + /* + * The resource ID of the Network Fabric l3IsolationDomain. + */ + @JsonProperty(value = "l3IsolationDomainId", required = true) + private String l3IsolationDomainId; + + /* + * The provisioning state of the default CNI network. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DefaultCniNetworkProvisioningState provisioningState; + + /* + * The VLAN from the l3IsolationDomain that is used for this network. + */ + @JsonProperty(value = "vlan", required = true) + private long vlan; + + /** Creates an instance of DefaultCniNetworkProperties class. */ + public DefaultCniNetworkProperties() { + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this default CNI network is associated + * with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the cniAsNumber property: The autonomous system number that the fabric expects to peer with, derived from the + * associated L3 isolation domain. + * + * @return the cniAsNumber value. + */ + public Long cniAsNumber() { + return this.cniAsNumber; + } + + /** + * Get the cniBgpConfiguration property: CniBgpConfiguration represents the Calico BGP configuration. + * + *

The Calico BGP configuration. + * + * @return the cniBgpConfiguration value. + */ + public CniBgpConfiguration cniBgpConfiguration() { + return this.cniBgpConfiguration; + } + + /** + * Set the cniBgpConfiguration property: CniBgpConfiguration represents the Calico BGP configuration. + * + *

The Calico BGP configuration. + * + * @param cniBgpConfiguration the cniBgpConfiguration value to set. + * @return the DefaultCniNetworkProperties object itself. + */ + public DefaultCniNetworkProperties withCniBgpConfiguration(CniBgpConfiguration cniBgpConfiguration) { + this.cniBgpConfiguration = cniBgpConfiguration; + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the default CNI network. + * + * @return the detailedStatus value. + */ + public DefaultCniNetworkDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the fabricBgpPeers property: The L3 isolation fabric BGP peering connectivity information necessary for BGP + * peering the Hybrid AKS Cluster with the switch fabric. + * + * @return the fabricBgpPeers value. + */ + public List fabricBgpPeers() { + return this.fabricBgpPeers; + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource ID(s) that are + * associated with this default CNI network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.hybridAksClustersAssociatedIds; + } + + /** + * Get the interfaceName property: The name of the interface that will be present in the virtual machine to + * represent this network. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Get the ipAllocationType property: The type of the IP address allocation. + * + * @return the ipAllocationType value. + */ + public IpAllocationType ipAllocationType() { + return this.ipAllocationType; + } + + /** + * Set the ipAllocationType property: The type of the IP address allocation. + * + * @param ipAllocationType the ipAllocationType value to set. + * @return the DefaultCniNetworkProperties object itself. + */ + public DefaultCniNetworkProperties withIpAllocationType(IpAllocationType ipAllocationType) { + this.ipAllocationType = ipAllocationType; + return this; + } + + /** + * Get the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV4 or DualStack. + * + * @return the ipv4ConnectedPrefix value. + */ + public String ipv4ConnectedPrefix() { + return this.ipv4ConnectedPrefix; + } + + /** + * Set the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV4 or DualStack. + * + * @param ipv4ConnectedPrefix the ipv4ConnectedPrefix value to set. + * @return the DefaultCniNetworkProperties object itself. + */ + public DefaultCniNetworkProperties withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { + this.ipv4ConnectedPrefix = ipv4ConnectedPrefix; + return this; + } + + /** + * Get the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV6 or DualStack. + * + * @return the ipv6ConnectedPrefix value. + */ + public String ipv6ConnectedPrefix() { + return this.ipv6ConnectedPrefix; + } + + /** + * Set the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV6 or DualStack. + * + * @param ipv6ConnectedPrefix the ipv6ConnectedPrefix value to set. + * @return the DefaultCniNetworkProperties object itself. + */ + public DefaultCniNetworkProperties withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { + this.ipv6ConnectedPrefix = ipv6ConnectedPrefix; + return this; + } + + /** + * Get the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @return the l3IsolationDomainId value. + */ + public String l3IsolationDomainId() { + return this.l3IsolationDomainId; + } + + /** + * Set the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @param l3IsolationDomainId the l3IsolationDomainId value to set. + * @return the DefaultCniNetworkProperties object itself. + */ + public DefaultCniNetworkProperties withL3IsolationDomainId(String l3IsolationDomainId) { + this.l3IsolationDomainId = l3IsolationDomainId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the default CNI network. + * + * @return the provisioningState value. + */ + public DefaultCniNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @return the vlan value. + */ + public long vlan() { + return this.vlan; + } + + /** + * Set the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @param vlan the vlan value to set. + * @return the DefaultCniNetworkProperties object itself. + */ + public DefaultCniNetworkProperties withVlan(long vlan) { + this.vlan = vlan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cniBgpConfiguration() != null) { + cniBgpConfiguration().validate(); + } + if (fabricBgpPeers() != null) { + fabricBgpPeers().forEach(e -> e.validate()); + } + if (l3IsolationDomainId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property l3IsolationDomainId in model DefaultCniNetworkProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DefaultCniNetworkProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/HybridAksClusterInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/HybridAksClusterInner.java new file mode 100644 index 000000000000..cb044a2592d1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/HybridAksClusterInner.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.NodeConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * HybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + * + *

The details are specific to the Network Cloud use of the Hybrid AKS cluster. + */ +@Fluent +public final class HybridAksClusterInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * HybridAksClusterProperties represents the properties of Hybrid AKS cluster resource. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private HybridAksClusterProperties innerProperties = new HybridAksClusterProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of HybridAksClusterInner class. */ + public HybridAksClusterInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the HybridAksClusterInner object itself. + */ + public HybridAksClusterInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: HybridAksClusterProperties represents the properties of Hybrid AKS cluster + * resource. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private HybridAksClusterProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public HybridAksClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public HybridAksClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the associatedNetworkIds property: The list of resource IDs for the workload networks associated with the + * Hybrid AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks resources. This field will also + * contain one cloudServicesNetwork and one defaultCniNetwork. + * + * @return the associatedNetworkIds value. + */ + public List associatedNetworkIds() { + return this.innerProperties() == null ? null : this.innerProperties().associatedNetworkIds(); + } + + /** + * Set the associatedNetworkIds property: The list of resource IDs for the workload networks associated with the + * Hybrid AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks resources. This field will also + * contain one cloudServicesNetwork and one defaultCniNetwork. + * + * @param associatedNetworkIds the associatedNetworkIds value to set. + * @return the HybridAksClusterInner object itself. + */ + public HybridAksClusterInner withAssociatedNetworkIds(List associatedNetworkIds) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridAksClusterProperties(); + } + this.innerProperties().withAssociatedNetworkIds(associatedNetworkIds); + return this; + } + + /** + * Get the cloudServicesNetworkId property: The resource ID of the associated cloud services network. + * + * @return the cloudServicesNetworkId value. + */ + public String cloudServicesNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().cloudServicesNetworkId(); + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster hosting the Hybrid AKS cluster. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the controlPlaneCount property: The number of control plane node VMs. + * + * @return the controlPlaneCount value. + */ + public long controlPlaneCount() { + return this.innerProperties() == null ? 0L : this.innerProperties().controlPlaneCount(); + } + + /** + * Set the controlPlaneCount property: The number of control plane node VMs. + * + * @param controlPlaneCount the controlPlaneCount value to set. + * @return the HybridAksClusterInner object itself. + */ + public HybridAksClusterInner withControlPlaneCount(long controlPlaneCount) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridAksClusterProperties(); + } + this.innerProperties().withControlPlaneCount(controlPlaneCount); + return this; + } + + /** + * Get the controlPlaneNodes property: The list of node configurations detailing associated VMs that are part of the + * control plane nodes of this Hybrid AKS cluster. + * + * @return the controlPlaneNodes value. + */ + public List controlPlaneNodes() { + return this.innerProperties() == null ? null : this.innerProperties().controlPlaneNodes(); + } + + /** + * Get the defaultCniNetworkId property: The resource ID of the associated default CNI network. + * + * @return the defaultCniNetworkId value. + */ + public String defaultCniNetworkId() { + return this.innerProperties() == null ? null : this.innerProperties().defaultCniNetworkId(); + } + + /** + * Get the detailedStatus property: The more detailed status of this Hybrid AKS cluster. + * + * @return the detailedStatus value. + */ + public HybridAksClusterDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the hybridAksProvisionedClusterId property: The resource ID of the Hybrid AKS cluster that this additional + * information is for. + * + * @return the hybridAksProvisionedClusterId value. + */ + public String hybridAksProvisionedClusterId() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksProvisionedClusterId(); + } + + /** + * Set the hybridAksProvisionedClusterId property: The resource ID of the Hybrid AKS cluster that this additional + * information is for. + * + * @param hybridAksProvisionedClusterId the hybridAksProvisionedClusterId value to set. + * @return the HybridAksClusterInner object itself. + */ + public HybridAksClusterInner withHybridAksProvisionedClusterId(String hybridAksProvisionedClusterId) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridAksClusterProperties(); + } + this.innerProperties().withHybridAksProvisionedClusterId(hybridAksProvisionedClusterId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Hybrid AKS cluster resource. + * + * @return the provisioningState value. + */ + public HybridAksClusterProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the volumes property: The resource IDs of volumes that are attached to the Hybrid AKS cluster. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Get the workerCount property: The number of worker node VMs. + * + * @return the workerCount value. + */ + public long workerCount() { + return this.innerProperties() == null ? 0L : this.innerProperties().workerCount(); + } + + /** + * Set the workerCount property: The number of worker node VMs. + * + * @param workerCount the workerCount value to set. + * @return the HybridAksClusterInner object itself. + */ + public HybridAksClusterInner withWorkerCount(long workerCount) { + if (this.innerProperties() == null) { + this.innerProperties = new HybridAksClusterProperties(); + } + this.innerProperties().withWorkerCount(workerCount); + return this; + } + + /** + * Get the workerNodes property: The list of node configurations detailing associated VMs that are part of the + * worker nodes of this Hybrid AKS cluster. + * + * @return the workerNodes value. + */ + public List workerNodes() { + return this.innerProperties() == null ? null : this.innerProperties().workerNodes(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model HybridAksClusterInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model HybridAksClusterInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridAksClusterInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/HybridAksClusterProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/HybridAksClusterProperties.java new file mode 100644 index 000000000000..09dd07fe2c8a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/HybridAksClusterProperties.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.NodeConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** HybridAksClusterProperties represents the properties of Hybrid AKS cluster resource. */ +@Fluent +public final class HybridAksClusterProperties { + /* + * The list of resource IDs for the workload networks associated with the Hybrid AKS cluster. It can be any of + * l2Networks, l3Networks, or trunkedNetworks resources. This field will also contain one cloudServicesNetwork and + * one defaultCniNetwork. + */ + @JsonProperty(value = "associatedNetworkIds", required = true) + private List associatedNetworkIds; + + /* + * The resource ID of the associated cloud services network. + */ + @JsonProperty(value = "cloudServicesNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String cloudServicesNetworkId; + + /* + * The resource ID of the Network Cloud cluster hosting the Hybrid AKS cluster. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The number of control plane node VMs. + */ + @JsonProperty(value = "controlPlaneCount", required = true) + private long controlPlaneCount; + + /* + * The list of node configurations detailing associated VMs that are part of the control plane nodes of this Hybrid + * AKS cluster. + */ + @JsonProperty(value = "controlPlaneNodes", access = JsonProperty.Access.WRITE_ONLY) + private List controlPlaneNodes; + + /* + * The resource ID of the associated default CNI network. + */ + @JsonProperty(value = "defaultCniNetworkId", access = JsonProperty.Access.WRITE_ONLY) + private String defaultCniNetworkId; + + /* + * The more detailed status of this Hybrid AKS cluster. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private HybridAksClusterDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The resource ID of the Hybrid AKS cluster that this additional information is for. + */ + @JsonProperty(value = "hybridAksProvisionedClusterId", required = true) + private String hybridAksProvisionedClusterId; + + /* + * The provisioning state of the Hybrid AKS cluster resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private HybridAksClusterProvisioningState provisioningState; + + /* + * The resource IDs of volumes that are attached to the Hybrid AKS cluster. + */ + @JsonProperty(value = "volumes", access = JsonProperty.Access.WRITE_ONLY) + private List volumes; + + /* + * The number of worker node VMs. + */ + @JsonProperty(value = "workerCount", required = true) + private long workerCount; + + /* + * The list of node configurations detailing associated VMs that are part of the worker nodes of this Hybrid AKS + * cluster. + */ + @JsonProperty(value = "workerNodes", access = JsonProperty.Access.WRITE_ONLY) + private List workerNodes; + + /** Creates an instance of HybridAksClusterProperties class. */ + public HybridAksClusterProperties() { + } + + /** + * Get the associatedNetworkIds property: The list of resource IDs for the workload networks associated with the + * Hybrid AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks resources. This field will also + * contain one cloudServicesNetwork and one defaultCniNetwork. + * + * @return the associatedNetworkIds value. + */ + public List associatedNetworkIds() { + return this.associatedNetworkIds; + } + + /** + * Set the associatedNetworkIds property: The list of resource IDs for the workload networks associated with the + * Hybrid AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks resources. This field will also + * contain one cloudServicesNetwork and one defaultCniNetwork. + * + * @param associatedNetworkIds the associatedNetworkIds value to set. + * @return the HybridAksClusterProperties object itself. + */ + public HybridAksClusterProperties withAssociatedNetworkIds(List associatedNetworkIds) { + this.associatedNetworkIds = associatedNetworkIds; + return this; + } + + /** + * Get the cloudServicesNetworkId property: The resource ID of the associated cloud services network. + * + * @return the cloudServicesNetworkId value. + */ + public String cloudServicesNetworkId() { + return this.cloudServicesNetworkId; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster hosting the Hybrid AKS cluster. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the controlPlaneCount property: The number of control plane node VMs. + * + * @return the controlPlaneCount value. + */ + public long controlPlaneCount() { + return this.controlPlaneCount; + } + + /** + * Set the controlPlaneCount property: The number of control plane node VMs. + * + * @param controlPlaneCount the controlPlaneCount value to set. + * @return the HybridAksClusterProperties object itself. + */ + public HybridAksClusterProperties withControlPlaneCount(long controlPlaneCount) { + this.controlPlaneCount = controlPlaneCount; + return this; + } + + /** + * Get the controlPlaneNodes property: The list of node configurations detailing associated VMs that are part of the + * control plane nodes of this Hybrid AKS cluster. + * + * @return the controlPlaneNodes value. + */ + public List controlPlaneNodes() { + return this.controlPlaneNodes; + } + + /** + * Get the defaultCniNetworkId property: The resource ID of the associated default CNI network. + * + * @return the defaultCniNetworkId value. + */ + public String defaultCniNetworkId() { + return this.defaultCniNetworkId; + } + + /** + * Get the detailedStatus property: The more detailed status of this Hybrid AKS cluster. + * + * @return the detailedStatus value. + */ + public HybridAksClusterDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the hybridAksProvisionedClusterId property: The resource ID of the Hybrid AKS cluster that this additional + * information is for. + * + * @return the hybridAksProvisionedClusterId value. + */ + public String hybridAksProvisionedClusterId() { + return this.hybridAksProvisionedClusterId; + } + + /** + * Set the hybridAksProvisionedClusterId property: The resource ID of the Hybrid AKS cluster that this additional + * information is for. + * + * @param hybridAksProvisionedClusterId the hybridAksProvisionedClusterId value to set. + * @return the HybridAksClusterProperties object itself. + */ + public HybridAksClusterProperties withHybridAksProvisionedClusterId(String hybridAksProvisionedClusterId) { + this.hybridAksProvisionedClusterId = hybridAksProvisionedClusterId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Hybrid AKS cluster resource. + * + * @return the provisioningState value. + */ + public HybridAksClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the volumes property: The resource IDs of volumes that are attached to the Hybrid AKS cluster. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Get the workerCount property: The number of worker node VMs. + * + * @return the workerCount value. + */ + public long workerCount() { + return this.workerCount; + } + + /** + * Set the workerCount property: The number of worker node VMs. + * + * @param workerCount the workerCount value to set. + * @return the HybridAksClusterProperties object itself. + */ + public HybridAksClusterProperties withWorkerCount(long workerCount) { + this.workerCount = workerCount; + return this; + } + + /** + * Get the workerNodes property: The list of node configurations detailing associated VMs that are part of the + * worker nodes of this Hybrid AKS cluster. + * + * @return the workerNodes value. + */ + public List workerNodes() { + return this.workerNodes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associatedNetworkIds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property associatedNetworkIds in model HybridAksClusterProperties")); + } + if (controlPlaneNodes() != null) { + controlPlaneNodes().forEach(e -> e.validate()); + } + if (hybridAksProvisionedClusterId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hybridAksProvisionedClusterId in model HybridAksClusterProperties")); + } + if (workerNodes() != null) { + workerNodes().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridAksClusterProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java new file mode 100644 index 000000000000..172dbd390c2b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkInner.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.L2NetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.L2NetworkProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. */ +@Fluent +public final class L2NetworkInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * L2NetworkProperties represents properties of the L2 network. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private L2NetworkProperties innerProperties = new L2NetworkProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of L2NetworkInner class. */ + public L2NetworkInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the L2NetworkInner object itself. + */ + public L2NetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: L2NetworkProperties represents properties of the L2 network. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private L2NetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public L2NetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public L2NetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this L2 network is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the detailedStatus property: The more detailed status of the L2 network. + * + * @return the detailedStatus value. + */ + public L2NetworkDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource ID(s) that are + * associated with this L2 network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksClustersAssociatedIds(); + } + + /** + * Get the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + public HybridAksPluginType hybridAksPluginType() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksPluginType(); + } + + /** + * Set the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @param hybridAksPluginType the hybridAksPluginType value to set. + * @return the L2NetworkInner object itself. + */ + public L2NetworkInner withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + if (this.innerProperties() == null) { + this.innerProperties = new L2NetworkProperties(); + } + this.innerProperties().withHybridAksPluginType(hybridAksPluginType); + return this; + } + + /** + * Get the interfaceName property: The default interface name for this L2 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); + } + + /** + * Set the interfaceName property: The default interface name for this L2 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @param interfaceName the interfaceName value to set. + * @return the L2NetworkInner object itself. + */ + public L2NetworkInner withInterfaceName(String interfaceName) { + if (this.innerProperties() == null) { + this.innerProperties = new L2NetworkProperties(); + } + this.innerProperties().withInterfaceName(interfaceName); + return this; + } + + /** + * Get the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. + * + * @return the l2IsolationDomainId value. + */ + public String l2IsolationDomainId() { + return this.innerProperties() == null ? null : this.innerProperties().l2IsolationDomainId(); + } + + /** + * Set the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. + * + * @param l2IsolationDomainId the l2IsolationDomainId value to set. + * @return the L2NetworkInner object itself. + */ + public L2NetworkInner withL2IsolationDomainId(String l2IsolationDomainId) { + if (this.innerProperties() == null) { + this.innerProperties = new L2NetworkProperties(); + } + this.innerProperties().withL2IsolationDomainId(l2IsolationDomainId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the L2 network. + * + * @return the provisioningState value. + */ + public L2NetworkProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource ID(s), excluding any Hybrid + * AKS virtual machines, that are currently using this L2 network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociatedIds(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model L2NetworkInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model L2NetworkInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(L2NetworkInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java new file mode 100644 index 000000000000..d1603a32b1c3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L2NetworkProperties.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.L2NetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.L2NetworkProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** L2NetworkProperties represents properties of the L2 network. */ +@Fluent +public final class L2NetworkProperties { + /* + * The resource ID of the Network Cloud cluster this L2 network is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The more detailed status of the L2 network. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private L2NetworkDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network. + */ + @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List hybridAksClustersAssociatedIds; + + /* + * The network plugin type for Hybrid AKS. + */ + @JsonProperty(value = "hybridAksPluginType") + private HybridAksPluginType hybridAksPluginType; + + /* + * The default interface name for this L2 network in the virtual machine. This name can be overridden by the name + * supplied in the network attachment configuration of that virtual machine. + */ + @JsonProperty(value = "interfaceName") + private String interfaceName; + + /* + * The resource ID of the Network Fabric l2IsolationDomain. + */ + @JsonProperty(value = "l2IsolationDomainId", required = true) + private String l2IsolationDomainId; + + /* + * The provisioning state of the L2 network. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private L2NetworkProvisioningState provisioningState; + + /* + * The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using + * this L2 network. + */ + @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociatedIds; + + /** Creates an instance of L2NetworkProperties class. */ + public L2NetworkProperties() { + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this L2 network is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the detailedStatus property: The more detailed status of the L2 network. + * + * @return the detailedStatus value. + */ + public L2NetworkDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource ID(s) that are + * associated with this L2 network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.hybridAksClustersAssociatedIds; + } + + /** + * Get the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + public HybridAksPluginType hybridAksPluginType() { + return this.hybridAksPluginType; + } + + /** + * Set the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @param hybridAksPluginType the hybridAksPluginType value to set. + * @return the L2NetworkProperties object itself. + */ + public L2NetworkProperties withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + this.hybridAksPluginType = hybridAksPluginType; + return this; + } + + /** + * Get the interfaceName property: The default interface name for this L2 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Set the interfaceName property: The default interface name for this L2 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @param interfaceName the interfaceName value to set. + * @return the L2NetworkProperties object itself. + */ + public L2NetworkProperties withInterfaceName(String interfaceName) { + this.interfaceName = interfaceName; + return this; + } + + /** + * Get the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. + * + * @return the l2IsolationDomainId value. + */ + public String l2IsolationDomainId() { + return this.l2IsolationDomainId; + } + + /** + * Set the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. + * + * @param l2IsolationDomainId the l2IsolationDomainId value to set. + * @return the L2NetworkProperties object itself. + */ + public L2NetworkProperties withL2IsolationDomainId(String l2IsolationDomainId) { + this.l2IsolationDomainId = l2IsolationDomainId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the L2 network. + * + * @return the provisioningState value. + */ + public L2NetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource ID(s), excluding any Hybrid + * AKS virtual machines, that are currently using this L2 network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.virtualMachinesAssociatedIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (l2IsolationDomainId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property l2IsolationDomainId in model L2NetworkProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(L2NetworkProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java new file mode 100644 index 000000000000..b0813b7b7fc3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkInner.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import com.azure.resourcemanager.networkcloud.models.L3NetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.L3NetworkProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. */ +@Fluent +public final class L3NetworkInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * L3NetworkProperties represents properties of the L3 network. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private L3NetworkProperties innerProperties = new L3NetworkProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of L3NetworkInner class. */ + public L3NetworkInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: L3NetworkProperties represents properties of the L3 network. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private L3NetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public L3NetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public L3NetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this L3 network is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the detailedStatus property: The more detailed status of the L3 network. + * + * @return the detailedStatus value. + */ + public L3NetworkDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this L3 network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksClustersAssociatedIds(); + } + + /** + * Get the hybridAksIpamEnabled property: The indicator of whether or not to disable IPAM allocation on the network + * attachment definition injected into the Hybrid AKS Cluster. + * + * @return the hybridAksIpamEnabled value. + */ + public HybridAksIpamEnabled hybridAksIpamEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksIpamEnabled(); + } + + /** + * Set the hybridAksIpamEnabled property: The indicator of whether or not to disable IPAM allocation on the network + * attachment definition injected into the Hybrid AKS Cluster. + * + * @param hybridAksIpamEnabled the hybridAksIpamEnabled value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withHybridAksIpamEnabled(HybridAksIpamEnabled hybridAksIpamEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withHybridAksIpamEnabled(hybridAksIpamEnabled); + return this; + } + + /** + * Get the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + public HybridAksPluginType hybridAksPluginType() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksPluginType(); + } + + /** + * Set the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @param hybridAksPluginType the hybridAksPluginType value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withHybridAksPluginType(hybridAksPluginType); + return this; + } + + /** + * Get the interfaceName property: The default interface name for this L3 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); + } + + /** + * Set the interfaceName property: The default interface name for this L3 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @param interfaceName the interfaceName value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withInterfaceName(String interfaceName) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withInterfaceName(interfaceName); + return this; + } + + /** + * Get the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". + * + * @return the ipAllocationType value. + */ + public IpAllocationType ipAllocationType() { + return this.innerProperties() == null ? null : this.innerProperties().ipAllocationType(); + } + + /** + * Set the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". + * + * @param ipAllocationType the ipAllocationType value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withIpAllocationType(IpAllocationType ipAllocationType) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withIpAllocationType(ipAllocationType); + return this; + } + + /** + * Get the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV4 or DualStack. + * + * @return the ipv4ConnectedPrefix value. + */ + public String ipv4ConnectedPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipv4ConnectedPrefix(); + } + + /** + * Set the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV4 or DualStack. + * + * @param ipv4ConnectedPrefix the ipv4ConnectedPrefix value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withIpv4ConnectedPrefix(ipv4ConnectedPrefix); + return this; + } + + /** + * Get the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV6 or DualStack. + * + * @return the ipv6ConnectedPrefix value. + */ + public String ipv6ConnectedPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipv6ConnectedPrefix(); + } + + /** + * Set the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV6 or DualStack. + * + * @param ipv6ConnectedPrefix the ipv6ConnectedPrefix value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withIpv6ConnectedPrefix(ipv6ConnectedPrefix); + return this; + } + + /** + * Get the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @return the l3IsolationDomainId value. + */ + public String l3IsolationDomainId() { + return this.innerProperties() == null ? null : this.innerProperties().l3IsolationDomainId(); + } + + /** + * Set the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @param l3IsolationDomainId the l3IsolationDomainId value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withL3IsolationDomainId(String l3IsolationDomainId) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withL3IsolationDomainId(l3IsolationDomainId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the L3 network. + * + * @return the provisioningState value. + */ + public L3NetworkProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid AKS + * virtual machines, that are currently using this L3 network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociatedIds(); + } + + /** + * Get the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @return the vlan value. + */ + public long vlan() { + return this.innerProperties() == null ? 0L : this.innerProperties().vlan(); + } + + /** + * Set the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @param vlan the vlan value to set. + * @return the L3NetworkInner object itself. + */ + public L3NetworkInner withVlan(long vlan) { + if (this.innerProperties() == null) { + this.innerProperties = new L3NetworkProperties(); + } + this.innerProperties().withVlan(vlan); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model L3NetworkInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model L3NetworkInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(L3NetworkInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java new file mode 100644 index 000000000000..b5ff24c368a3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/L3NetworkProperties.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import com.azure.resourcemanager.networkcloud.models.L3NetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.L3NetworkProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** L3NetworkProperties represents properties of the L3 network. */ +@Fluent +public final class L3NetworkProperties { + /* + * The resource ID of the Network Cloud cluster this L3 network is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The more detailed status of the L3 network. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private L3NetworkDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The list of Hybrid AKS cluster resource IDs that are associated with this L3 network. + */ + @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List hybridAksClustersAssociatedIds; + + /* + * The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into + * the Hybrid AKS Cluster. + */ + @JsonProperty(value = "hybridAksIpamEnabled") + private HybridAksIpamEnabled hybridAksIpamEnabled; + + /* + * The network plugin type for Hybrid AKS. + */ + @JsonProperty(value = "hybridAksPluginType") + private HybridAksPluginType hybridAksPluginType; + + /* + * The default interface name for this L3 network in the virtual machine. This name can be overridden by the name + * supplied in the network attachment configuration of that virtual machine. + */ + @JsonProperty(value = "interfaceName") + private String interfaceName; + + /* + * The type of the IP address allocation, defaulted to "DualStack". + */ + @JsonProperty(value = "ipAllocationType") + private IpAllocationType ipAllocationType; + + /* + * The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type + * is IPV4 or DualStack. + */ + @JsonProperty(value = "ipv4ConnectedPrefix") + private String ipv4ConnectedPrefix; + + /* + * The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type + * is IPV6 or DualStack. + */ + @JsonProperty(value = "ipv6ConnectedPrefix") + private String ipv6ConnectedPrefix; + + /* + * The resource ID of the Network Fabric l3IsolationDomain. + */ + @JsonProperty(value = "l3IsolationDomainId", required = true) + private String l3IsolationDomainId; + + /* + * The provisioning state of the L3 network. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private L3NetworkProvisioningState provisioningState; + + /* + * The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using + * this L3 network. + */ + @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociatedIds; + + /* + * The VLAN from the l3IsolationDomain that is used for this network. + */ + @JsonProperty(value = "vlan", required = true) + private long vlan; + + /** Creates an instance of L3NetworkProperties class. */ + public L3NetworkProperties() { + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this L3 network is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the detailedStatus property: The more detailed status of the L3 network. + * + * @return the detailedStatus value. + */ + public L3NetworkDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this L3 network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.hybridAksClustersAssociatedIds; + } + + /** + * Get the hybridAksIpamEnabled property: The indicator of whether or not to disable IPAM allocation on the network + * attachment definition injected into the Hybrid AKS Cluster. + * + * @return the hybridAksIpamEnabled value. + */ + public HybridAksIpamEnabled hybridAksIpamEnabled() { + return this.hybridAksIpamEnabled; + } + + /** + * Set the hybridAksIpamEnabled property: The indicator of whether or not to disable IPAM allocation on the network + * attachment definition injected into the Hybrid AKS Cluster. + * + * @param hybridAksIpamEnabled the hybridAksIpamEnabled value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withHybridAksIpamEnabled(HybridAksIpamEnabled hybridAksIpamEnabled) { + this.hybridAksIpamEnabled = hybridAksIpamEnabled; + return this; + } + + /** + * Get the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + public HybridAksPluginType hybridAksPluginType() { + return this.hybridAksPluginType; + } + + /** + * Set the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @param hybridAksPluginType the hybridAksPluginType value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + this.hybridAksPluginType = hybridAksPluginType; + return this; + } + + /** + * Get the interfaceName property: The default interface name for this L3 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Set the interfaceName property: The default interface name for this L3 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @param interfaceName the interfaceName value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withInterfaceName(String interfaceName) { + this.interfaceName = interfaceName; + return this; + } + + /** + * Get the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". + * + * @return the ipAllocationType value. + */ + public IpAllocationType ipAllocationType() { + return this.ipAllocationType; + } + + /** + * Set the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". + * + * @param ipAllocationType the ipAllocationType value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withIpAllocationType(IpAllocationType ipAllocationType) { + this.ipAllocationType = ipAllocationType; + return this; + } + + /** + * Get the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV4 or DualStack. + * + * @return the ipv4ConnectedPrefix value. + */ + public String ipv4ConnectedPrefix() { + return this.ipv4ConnectedPrefix; + } + + /** + * Set the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV4 or DualStack. + * + * @param ipv4ConnectedPrefix the ipv4ConnectedPrefix value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { + this.ipv4ConnectedPrefix = ipv4ConnectedPrefix; + return this; + } + + /** + * Get the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV6 or DualStack. + * + * @return the ipv6ConnectedPrefix value. + */ + public String ipv6ConnectedPrefix() { + return this.ipv6ConnectedPrefix; + } + + /** + * Set the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV6 or DualStack. + * + * @param ipv6ConnectedPrefix the ipv6ConnectedPrefix value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { + this.ipv6ConnectedPrefix = ipv6ConnectedPrefix; + return this; + } + + /** + * Get the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @return the l3IsolationDomainId value. + */ + public String l3IsolationDomainId() { + return this.l3IsolationDomainId; + } + + /** + * Set the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @param l3IsolationDomainId the l3IsolationDomainId value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withL3IsolationDomainId(String l3IsolationDomainId) { + this.l3IsolationDomainId = l3IsolationDomainId; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the L3 network. + * + * @return the provisioningState value. + */ + public L3NetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid AKS + * virtual machines, that are currently using this L3 network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.virtualMachinesAssociatedIds; + } + + /** + * Get the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @return the vlan value. + */ + public long vlan() { + return this.vlan; + } + + /** + * Set the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @param vlan the vlan value to set. + * @return the L3NetworkProperties object itself. + */ + public L3NetworkProperties withVlan(long vlan) { + this.vlan = vlan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (l3IsolationDomainId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property l3IsolationDomainId in model L3NetworkProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(L3NetworkProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java new file mode 100644 index 000000000000..247a6080220f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/MachineSkuProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.networkcloud.models.BootstrapProtocol; +import com.azure.resourcemanager.networkcloud.models.MachineDisk; +import com.azure.resourcemanager.networkcloud.models.NetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MachineSkuProperties represents the properties of the machine SKU. */ +@Immutable +public final class MachineSkuProperties { + /* + * The type of bootstrap protocol used. + */ + @JsonProperty(value = "bootstrapProtocol", access = JsonProperty.Access.WRITE_ONLY) + private BootstrapProtocol bootstrapProtocol; + + /* + * The count of CPU cores for this machine. + */ + @JsonProperty(value = "cpuCores", access = JsonProperty.Access.WRITE_ONLY) + private Long cpuCores; + + /* + * The count of CPU sockets for this machine. + */ + @JsonProperty(value = "cpuSockets", access = JsonProperty.Access.WRITE_ONLY) + private Long cpuSockets; + + /* + * The list of disks. + */ + @JsonProperty(value = "disks", access = JsonProperty.Access.WRITE_ONLY) + private List disks; + + /* + * The generation of the architecture. + */ + @JsonProperty(value = "generation", access = JsonProperty.Access.WRITE_ONLY) + private String generation; + + /* + * The hardware version of the machine. + */ + @JsonProperty(value = "hardwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String hardwareVersion; + + /* + * The maximum amount of memory in GB. + */ + @JsonProperty(value = "memoryCapacityGB", access = JsonProperty.Access.WRITE_ONLY) + private Long memoryCapacityGB; + + /* + * The model of the machine. + */ + @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) + private String model; + + /* + * The list of network interfaces. + */ + @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) + private List networkInterfaces; + + /* + * The count of SMT and physical core threads for this machine. + */ + @JsonProperty(value = "totalThreads", access = JsonProperty.Access.WRITE_ONLY) + private Long totalThreads; + + /* + * The make of the machine. + */ + @JsonProperty(value = "vendor", access = JsonProperty.Access.WRITE_ONLY) + private String vendor; + + /** Creates an instance of MachineSkuProperties class. */ + public MachineSkuProperties() { + } + + /** + * Get the bootstrapProtocol property: The type of bootstrap protocol used. + * + * @return the bootstrapProtocol value. + */ + public BootstrapProtocol bootstrapProtocol() { + return this.bootstrapProtocol; + } + + /** + * Get the cpuCores property: The count of CPU cores for this machine. + * + * @return the cpuCores value. + */ + public Long cpuCores() { + return this.cpuCores; + } + + /** + * Get the cpuSockets property: The count of CPU sockets for this machine. + * + * @return the cpuSockets value. + */ + public Long cpuSockets() { + return this.cpuSockets; + } + + /** + * Get the disks property: The list of disks. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Get the generation property: The generation of the architecture. + * + * @return the generation value. + */ + public String generation() { + return this.generation; + } + + /** + * Get the hardwareVersion property: The hardware version of the machine. + * + * @return the hardwareVersion value. + */ + public String hardwareVersion() { + return this.hardwareVersion; + } + + /** + * Get the memoryCapacityGB property: The maximum amount of memory in GB. + * + * @return the memoryCapacityGB value. + */ + public Long memoryCapacityGB() { + return this.memoryCapacityGB; + } + + /** + * Get the model property: The model of the machine. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Get the networkInterfaces property: The list of network interfaces. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Get the totalThreads property: The count of SMT and physical core threads for this machine. + * + * @return the totalThreads value. + */ + public Long totalThreads() { + return this.totalThreads; + } + + /** + * Get the vendor property: The make of the machine. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java new file mode 100644 index 000000000000..ab86f70e73e5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.ActionType; +import com.azure.resourcemanager.networkcloud.models.OperationDisplay; +import com.azure.resourcemanager.networkcloud.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java new file mode 100644 index 000000000000..355dbe636f35 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackInner.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.RackDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.RackProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. */ +@Fluent +public final class RackInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * RackProperties represents the properties of the rack. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private RackProperties innerProperties = new RackProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RackInner class. */ + public RackInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the RackInner object itself. + */ + public RackInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: RackProperties represents the properties of the rack. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private RackProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public RackInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RackInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the availabilityZone property: The value that will be used for machines in this rack to represent the + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZone(); + } + + /** + * Set the availabilityZone property: The value that will be used for machines in this rack to represent the + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * + * @param availabilityZone the availabilityZone value to set. + * @return the RackInner object itself. + */ + public RackInner withAvailabilityZone(String availabilityZone) { + if (this.innerProperties() == null) { + this.innerProperties = new RackProperties(); + } + this.innerProperties().withAvailabilityZone(availabilityZone); + return this; + } + + /** + * Get the clusterId property: The resource ID of the cluster the rack is created for. This value is set when the + * rack is created by the cluster. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the detailedStatus property: The more detailed status of the rack. + * + * @return the detailedStatus value. + */ + public RackDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the provisioningState property: The provisioning state of the rack resource. + * + * @return the provisioningState value. + */ + public RackProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @return the rackLocation value. + */ + public String rackLocation() { + return this.innerProperties() == null ? null : this.innerProperties().rackLocation(); + } + + /** + * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @param rackLocation the rackLocation value to set. + * @return the RackInner object itself. + */ + public RackInner withRackLocation(String rackLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new RackProperties(); + } + this.innerProperties().withRackLocation(rackLocation); + return this; + } + + /** + * Get the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @return the rackSerialNumber value. + */ + public String rackSerialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().rackSerialNumber(); + } + + /** + * Set the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @param rackSerialNumber the rackSerialNumber value to set. + * @return the RackInner object itself. + */ + public RackInner withRackSerialNumber(String rackSerialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new RackProperties(); + } + this.innerProperties().withRackSerialNumber(rackSerialNumber); + return this; + } + + /** + * Get the rackSkuId property: The SKU for the rack. + * + * @return the rackSkuId value. + */ + public String rackSkuId() { + return this.innerProperties() == null ? null : this.innerProperties().rackSkuId(); + } + + /** + * Set the rackSkuId property: The SKU for the rack. + * + * @param rackSkuId the rackSkuId value to set. + * @return the RackInner object itself. + */ + public RackInner withRackSkuId(String rackSkuId) { + if (this.innerProperties() == null) { + this.innerProperties = new RackProperties(); + } + this.innerProperties().withRackSkuId(rackSkuId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model RackInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model RackInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RackInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java new file mode 100644 index 000000000000..1a8c50f9d18a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackProperties.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.RackDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.RackProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RackProperties represents the properties of the rack. */ +@Fluent +public final class RackProperties { + /* + * The value that will be used for machines in this rack to represent the availability zones that can be referenced + * by Hybrid AKS Clusters for node arrangement. + */ + @JsonProperty(value = "availabilityZone", required = true) + private String availabilityZone; + + /* + * The resource ID of the cluster the rack is created for. This value is set when the rack is created by the + * cluster. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The more detailed status of the rack. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private RackDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The provisioning state of the rack resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private RackProvisioningState provisioningState; + + /* + * The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + */ + @JsonProperty(value = "rackLocation", required = true) + private String rackLocation; + + /* + * The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other + * than a serial number may be provided if desired. + */ + @JsonProperty(value = "rackSerialNumber", required = true) + private String rackSerialNumber; + + /* + * The SKU for the rack. + */ + @JsonProperty(value = "rackSkuId", required = true) + private String rackSkuId; + + /** Creates an instance of RackProperties class. */ + public RackProperties() { + } + + /** + * Get the availabilityZone property: The value that will be used for machines in this rack to represent the + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The value that will be used for machines in this rack to represent the + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * + * @param availabilityZone the availabilityZone value to set. + * @return the RackProperties object itself. + */ + public RackProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the clusterId property: The resource ID of the cluster the rack is created for. This value is set when the + * rack is created by the cluster. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the detailedStatus property: The more detailed status of the rack. + * + * @return the detailedStatus value. + */ + public RackDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the provisioningState property: The provisioning state of the rack resource. + * + * @return the provisioningState value. + */ + public RackProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @return the rackLocation value. + */ + public String rackLocation() { + return this.rackLocation; + } + + /** + * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @param rackLocation the rackLocation value to set. + * @return the RackProperties object itself. + */ + public RackProperties withRackLocation(String rackLocation) { + this.rackLocation = rackLocation; + return this; + } + + /** + * Get the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @return the rackSerialNumber value. + */ + public String rackSerialNumber() { + return this.rackSerialNumber; + } + + /** + * Set the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @param rackSerialNumber the rackSerialNumber value to set. + * @return the RackProperties object itself. + */ + public RackProperties withRackSerialNumber(String rackSerialNumber) { + this.rackSerialNumber = rackSerialNumber; + return this; + } + + /** + * Get the rackSkuId property: The SKU for the rack. + * + * @return the rackSkuId value. + */ + public String rackSkuId() { + return this.rackSkuId; + } + + /** + * Set the rackSkuId property: The SKU for the rack. + * + * @param rackSkuId the rackSkuId value to set. + * @return the RackProperties object itself. + */ + public RackProperties withRackSkuId(String rackSkuId) { + this.rackSkuId = rackSkuId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilityZone() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property availabilityZone in model RackProperties")); + } + if (rackLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rackLocation in model RackProperties")); + } + if (rackSerialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rackSerialNumber in model RackProperties")); + } + if (rackSkuId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rackSkuId in model RackProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RackProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java new file mode 100644 index 000000000000..cc8b6c78e60a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuInner.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.MachineSkuSlot; +import com.azure.resourcemanager.networkcloud.models.RackSkuProvisioningState; +import com.azure.resourcemanager.networkcloud.models.RackSkuType; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RackSku represents the SKU information of the rack. */ +@Immutable +public final class RackSkuInner extends ProxyResource { + /* + * RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both + * aggregator and compute racks. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private RackSkuProperties innerProperties = new RackSkuProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of RackSkuInner class. */ + public RackSkuInner() { + } + + /** + * Get the innerProperties property: RackSkuProperties represents the properties of compute-related hardware for a + * rack. This supports both aggregator and compute racks. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private RackSkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated + * machines in this rack model. + * + * @return the computeMachines value. + */ + public List computeMachines() { + return this.innerProperties() == null ? null : this.innerProperties().computeMachines(); + } + + /** + * Get the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane + * dedicated machines in this rack model. + * + * @return the controllerMachines value. + */ + public List controllerMachines() { + return this.innerProperties() == null ? null : this.innerProperties().controllerMachines(); + } + + /** + * Get the description property: The free-form text describing the rack. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this + * is a compute rack or a rack for a single rack cluster(rackType="Single"). + * + * @return the maxClusterSlots value. + */ + public Long maxClusterSlots() { + return this.innerProperties() == null ? null : this.innerProperties().maxClusterSlots(); + } + + /** + * Get the provisioningState property: The provisioning state of the rack SKU resource. + * + * @return the provisioningState value. + */ + public RackSkuProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the rackType property: The type of the rack. + * + * @return the rackType value. + */ + public RackSkuType rackType() { + return this.innerProperties() == null ? null : this.innerProperties().rackType(); + } + + /** + * Get the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage + * appliance(s) in this rack model. + * + * @return the storageAppliances value. + */ + public List storageAppliances() { + return this.innerProperties() == null ? null : this.innerProperties().storageAppliances(); + } + + /** + * Get the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator. + * + * @return the supportedRackSkuIds value. + */ + public List supportedRackSkuIds() { + return this.innerProperties() == null ? null : this.innerProperties().supportedRackSkuIds(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model RackSkuInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RackSkuInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java new file mode 100644 index 000000000000..8b8b61e44f38 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RackSkuProperties.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.networkcloud.models.MachineSkuSlot; +import com.azure.resourcemanager.networkcloud.models.RackSkuProvisioningState; +import com.azure.resourcemanager.networkcloud.models.RackSkuType; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and + * compute racks. + */ +@Immutable +public final class RackSkuProperties { + /* + * The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + */ + @JsonProperty(value = "computeMachines", access = JsonProperty.Access.WRITE_ONLY) + private List computeMachines; + + /* + * The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + */ + @JsonProperty(value = "controllerMachines", access = JsonProperty.Access.WRITE_ONLY) + private List controllerMachines; + + /* + * The free-form text describing the rack. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a + * single rack cluster(rackType="Single"). + */ + @JsonProperty(value = "maxClusterSlots", access = JsonProperty.Access.WRITE_ONLY) + private Long maxClusterSlots; + + /* + * The provisioning state of the rack SKU resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private RackSkuProvisioningState provisioningState; + + /* + * The type of the rack. + */ + @JsonProperty(value = "rackType", access = JsonProperty.Access.WRITE_ONLY) + private RackSkuType rackType; + + /* + * The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + */ + @JsonProperty(value = "storageAppliances", access = JsonProperty.Access.WRITE_ONLY) + private List storageAppliances; + + /* + * The list of supported SKUs if the rack is an aggregator. + */ + @JsonProperty(value = "supportedRackSkuIds", access = JsonProperty.Access.WRITE_ONLY) + private List supportedRackSkuIds; + + /** Creates an instance of RackSkuProperties class. */ + public RackSkuProperties() { + } + + /** + * Get the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated + * machines in this rack model. + * + * @return the computeMachines value. + */ + public List computeMachines() { + return this.computeMachines; + } + + /** + * Get the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane + * dedicated machines in this rack model. + * + * @return the controllerMachines value. + */ + public List controllerMachines() { + return this.controllerMachines; + } + + /** + * Get the description property: The free-form text describing the rack. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this + * is a compute rack or a rack for a single rack cluster(rackType="Single"). + * + * @return the maxClusterSlots value. + */ + public Long maxClusterSlots() { + return this.maxClusterSlots; + } + + /** + * Get the provisioningState property: The provisioning state of the rack SKU resource. + * + * @return the provisioningState value. + */ + public RackSkuProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the rackType property: The type of the rack. + * + * @return the rackType value. + */ + public RackSkuType rackType() { + return this.rackType; + } + + /** + * Get the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage + * appliance(s) in this rack model. + * + * @return the storageAppliances value. + */ + public List storageAppliances() { + return this.storageAppliances; + } + + /** + * Get the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator. + * + * @return the supportedRackSkuIds value. + */ + public List supportedRackSkuIds() { + return this.supportedRackSkuIds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (computeMachines() != null) { + computeMachines().forEach(e -> e.validate()); + } + if (controllerMachines() != null) { + controllerMachines().forEach(e -> e.validate()); + } + if (storageAppliances() != null) { + storageAppliances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java new file mode 100644 index 000000000000..33830146494d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/RacksPatchProperties.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RacksPatchProperties represents the properties of the rack during patching. */ +@Fluent +public final class RacksPatchProperties { + /* + * The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + */ + @JsonProperty(value = "rackLocation") + private String rackLocation; + + /* + * The globally unique identifier for the rack. + */ + @JsonProperty(value = "rackSerialNumber") + private String rackSerialNumber; + + /** Creates an instance of RacksPatchProperties class. */ + public RacksPatchProperties() { + } + + /** + * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @return the rackLocation value. + */ + public String rackLocation() { + return this.rackLocation; + } + + /** + * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @param rackLocation the rackLocation value to set. + * @return the RacksPatchProperties object itself. + */ + public RacksPatchProperties withRackLocation(String rackLocation) { + this.rackLocation = rackLocation; + return this; + } + + /** + * Get the rackSerialNumber property: The globally unique identifier for the rack. + * + * @return the rackSerialNumber value. + */ + public String rackSerialNumber() { + return this.rackSerialNumber; + } + + /** + * Set the rackSerialNumber property: The globally unique identifier for the rack. + * + * @param rackSerialNumber the rackSerialNumber value to set. + * @return the RacksPatchProperties object itself. + */ + public RacksPatchProperties withRackSerialNumber(String rackSerialNumber) { + this.rackSerialNumber = rackSerialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java new file mode 100644 index 000000000000..225c5baeca95 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceInner.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature; +import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** StorageAppliance represents on-premises Network Cloud storage appliance. */ +@Fluent +public final class StorageApplianceInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * StorageApplianceProperties represents the properties of the storage appliance. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private StorageApplianceProperties innerProperties = new StorageApplianceProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of StorageApplianceInner class. */ + public StorageApplianceInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StorageApplianceInner object itself. + */ + public StorageApplianceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: StorageApplianceProperties represents the properties of the storage appliance. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private StorageApplianceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public StorageApplianceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageApplianceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the + * device requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @return the administratorCredentials value. + */ + public AdministrativeCredentials administratorCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().administratorCredentials(); + } + + /** + * Set the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the + * device requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @param administratorCredentials the administratorCredentials value to set. + * @return the StorageApplianceInner object itself. + */ + public StorageApplianceInner withAdministratorCredentials(AdministrativeCredentials administratorCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageApplianceProperties(); + } + this.innerProperties().withAdministratorCredentials(administratorCredentials); + return this; + } + + /** + * Get the capacity property: The total capacity of the storage appliance. + * + * @return the capacity value. + */ + public Long capacity() { + return this.innerProperties() == null ? null : this.innerProperties().capacity(); + } + + /** + * Get the capacityUsed property: The amount of storage consumed. + * + * @return the capacityUsed value. + */ + public Long capacityUsed() { + return this.innerProperties() == null ? null : this.innerProperties().capacityUsed(); + } + + /** + * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the detailedStatus property: The detailed status of the storage appliance. + * + * @return the detailedStatus value. + */ + public StorageApplianceDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the managementIpv4Address property: The endpoint for the management interface of the storage appliance. + * + * @return the managementIpv4Address value. + */ + public String managementIpv4Address() { + return this.innerProperties() == null ? null : this.innerProperties().managementIpv4Address(); + } + + /** + * Get the provisioningState property: The provisioning state of the storage appliance. + * + * @return the provisioningState value. + */ + public StorageApplianceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the rackId property: The resource ID of the rack where this storage appliance resides. + * + * @return the rackId value. + */ + public String rackId() { + return this.innerProperties() == null ? null : this.innerProperties().rackId(); + } + + /** + * Set the rackId property: The resource ID of the rack where this storage appliance resides. + * + * @param rackId the rackId value to set. + * @return the StorageApplianceInner object itself. + */ + public StorageApplianceInner withRackId(String rackId) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageApplianceProperties(); + } + this.innerProperties().withRackId(rackId); + return this; + } + + /** + * Get the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. + * + * @return the rackSlot value. + */ + public long rackSlot() { + return this.innerProperties() == null ? 0L : this.innerProperties().rackSlot(); + } + + /** + * Set the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. + * + * @param rackSlot the rackSlot value to set. + * @return the StorageApplianceInner object itself. + */ + public StorageApplianceInner withRackSlot(long rackSlot) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageApplianceProperties(); + } + this.innerProperties().withRackSlot(rackSlot); + return this; + } + + /** + * Get the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote + * vendor management. + * + * @return the remoteVendorManagementFeature value. + */ + public RemoteVendorManagementFeature remoteVendorManagementFeature() { + return this.innerProperties() == null ? null : this.innerProperties().remoteVendorManagementFeature(); + } + + /** + * Get the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is + * enabled or disabled, or unsupported if it is an unsupported feature. + * + * @return the remoteVendorManagementStatus value. + */ + public RemoteVendorManagementStatus remoteVendorManagementStatus() { + return this.innerProperties() == null ? null : this.innerProperties().remoteVendorManagementStatus(); + } + + /** + * Get the serialNumber property: The serial number for the storage appliance. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Set the serialNumber property: The serial number for the storage appliance. + * + * @param serialNumber the serialNumber value to set. + * @return the StorageApplianceInner object itself. + */ + public StorageApplianceInner withSerialNumber(String serialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageApplianceProperties(); + } + this.innerProperties().withSerialNumber(serialNumber); + return this; + } + + /** + * Get the storageApplianceSkuId property: The SKU for the storage appliance. + * + * @return the storageApplianceSkuId value. + */ + public String storageApplianceSkuId() { + return this.innerProperties() == null ? null : this.innerProperties().storageApplianceSkuId(); + } + + /** + * Set the storageApplianceSkuId property: The SKU for the storage appliance. + * + * @param storageApplianceSkuId the storageApplianceSkuId value to set. + * @return the StorageApplianceInner object itself. + */ + public StorageApplianceInner withStorageApplianceSkuId(String storageApplianceSkuId) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageApplianceProperties(); + } + this.innerProperties().withStorageApplianceSkuId(storageApplianceSkuId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model StorageApplianceInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model StorageApplianceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java new file mode 100644 index 000000000000..27056f1b7348 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageAppliancePatchProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageAppliancePatchProperties represents the properties of the storage appliance that can be patched. */ +@Fluent +public final class StorageAppliancePatchProperties { + /* + * The serial number for the storage appliance. + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of StorageAppliancePatchProperties class. */ + public StorageAppliancePatchProperties() { + } + + /** + * Get the serialNumber property: The serial number for the storage appliance. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number for the storage appliance. + * + * @param serialNumber the serialNumber value to set. + * @return the StorageAppliancePatchProperties object itself. + */ + public StorageAppliancePatchProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java new file mode 100644 index 000000000000..71fe092a10eb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceProperties.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature; +import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageApplianceProperties represents the properties of the storage appliance. */ +@Fluent +public final class StorageApplianceProperties { + /* + * AdministrativeCredentials represents the admin credentials for the device requiring password-based + * authentication. + * + * The credentials of the administrative interface on this storage appliance. + */ + @JsonProperty(value = "administratorCredentials", required = true) + private AdministrativeCredentials administratorCredentials; + + /* + * The total capacity of the storage appliance. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private Long capacity; + + /* + * The amount of storage consumed. + */ + @JsonProperty(value = "capacityUsed", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityUsed; + + /* + * The resource ID of the cluster this storage appliance is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The detailed status of the storage appliance. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private StorageApplianceDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The endpoint for the management interface of the storage appliance. + */ + @JsonProperty(value = "managementIpv4Address", access = JsonProperty.Access.WRITE_ONLY) + private String managementIpv4Address; + + /* + * The provisioning state of the storage appliance. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private StorageApplianceProvisioningState provisioningState; + + /* + * The resource ID of the rack where this storage appliance resides. + */ + @JsonProperty(value = "rackId", required = true) + private String rackId; + + /* + * The slot the storage appliance is in the rack based on the BOM configuration. + */ + @JsonProperty(value = "rackSlot", required = true) + private long rackSlot; + + /* + * The indicator of whether the storage appliance supports remote vendor management. + */ + @JsonProperty(value = "remoteVendorManagementFeature", access = JsonProperty.Access.WRITE_ONLY) + private RemoteVendorManagementFeature remoteVendorManagementFeature; + + /* + * The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an + * unsupported feature. + */ + @JsonProperty(value = "remoteVendorManagementStatus", access = JsonProperty.Access.WRITE_ONLY) + private RemoteVendorManagementStatus remoteVendorManagementStatus; + + /* + * The serial number for the storage appliance. + */ + @JsonProperty(value = "serialNumber", required = true) + private String serialNumber; + + /* + * The SKU for the storage appliance. + */ + @JsonProperty(value = "storageApplianceSkuId", required = true) + private String storageApplianceSkuId; + + /** Creates an instance of StorageApplianceProperties class. */ + public StorageApplianceProperties() { + } + + /** + * Get the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the + * device requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @return the administratorCredentials value. + */ + public AdministrativeCredentials administratorCredentials() { + return this.administratorCredentials; + } + + /** + * Set the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the + * device requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @param administratorCredentials the administratorCredentials value to set. + * @return the StorageApplianceProperties object itself. + */ + public StorageApplianceProperties withAdministratorCredentials(AdministrativeCredentials administratorCredentials) { + this.administratorCredentials = administratorCredentials; + return this; + } + + /** + * Get the capacity property: The total capacity of the storage appliance. + * + * @return the capacity value. + */ + public Long capacity() { + return this.capacity; + } + + /** + * Get the capacityUsed property: The amount of storage consumed. + * + * @return the capacityUsed value. + */ + public Long capacityUsed() { + return this.capacityUsed; + } + + /** + * Get the clusterId property: The resource ID of the cluster this storage appliance is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the detailedStatus property: The detailed status of the storage appliance. + * + * @return the detailedStatus value. + */ + public StorageApplianceDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the managementIpv4Address property: The endpoint for the management interface of the storage appliance. + * + * @return the managementIpv4Address value. + */ + public String managementIpv4Address() { + return this.managementIpv4Address; + } + + /** + * Get the provisioningState property: The provisioning state of the storage appliance. + * + * @return the provisioningState value. + */ + public StorageApplianceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the rackId property: The resource ID of the rack where this storage appliance resides. + * + * @return the rackId value. + */ + public String rackId() { + return this.rackId; + } + + /** + * Set the rackId property: The resource ID of the rack where this storage appliance resides. + * + * @param rackId the rackId value to set. + * @return the StorageApplianceProperties object itself. + */ + public StorageApplianceProperties withRackId(String rackId) { + this.rackId = rackId; + return this; + } + + /** + * Get the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. + * + * @return the rackSlot value. + */ + public long rackSlot() { + return this.rackSlot; + } + + /** + * Set the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. + * + * @param rackSlot the rackSlot value to set. + * @return the StorageApplianceProperties object itself. + */ + public StorageApplianceProperties withRackSlot(long rackSlot) { + this.rackSlot = rackSlot; + return this; + } + + /** + * Get the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote + * vendor management. + * + * @return the remoteVendorManagementFeature value. + */ + public RemoteVendorManagementFeature remoteVendorManagementFeature() { + return this.remoteVendorManagementFeature; + } + + /** + * Get the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is + * enabled or disabled, or unsupported if it is an unsupported feature. + * + * @return the remoteVendorManagementStatus value. + */ + public RemoteVendorManagementStatus remoteVendorManagementStatus() { + return this.remoteVendorManagementStatus; + } + + /** + * Get the serialNumber property: The serial number for the storage appliance. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number for the storage appliance. + * + * @param serialNumber the serialNumber value to set. + * @return the StorageApplianceProperties object itself. + */ + public StorageApplianceProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the storageApplianceSkuId property: The SKU for the storage appliance. + * + * @return the storageApplianceSkuId value. + */ + public String storageApplianceSkuId() { + return this.storageApplianceSkuId; + } + + /** + * Set the storageApplianceSkuId property: The SKU for the storage appliance. + * + * @param storageApplianceSkuId the storageApplianceSkuId value to set. + * @return the StorageApplianceProperties object itself. + */ + public StorageApplianceProperties withStorageApplianceSkuId(String storageApplianceSkuId) { + this.storageApplianceSkuId = storageApplianceSkuId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (administratorCredentials() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property administratorCredentials in model StorageApplianceProperties")); + } else { + administratorCredentials().validate(); + } + if (rackId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property rackId in model StorageApplianceProperties")); + } + if (serialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serialNumber in model StorageApplianceProperties")); + } + if (storageApplianceSkuId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageApplianceSkuId in model StorageApplianceProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java new file mode 100644 index 000000000000..cbaefbff094c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/StorageApplianceSkuProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageApplianceSkuProperties represents the properties of the storage appliance SKU. */ +@Immutable +public final class StorageApplianceSkuProperties { + /* + * The maximum capacity of the storage appliance. + */ + @JsonProperty(value = "capacityGB", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityGB; + + /* + * The model of the storage appliance. + */ + @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) + private String model; + + /** Creates an instance of StorageApplianceSkuProperties class. */ + public StorageApplianceSkuProperties() { + } + + /** + * Get the capacityGB property: The maximum capacity of the storage appliance. + * + * @return the capacityGB value. + */ + public Long capacityGB() { + return this.capacityGB; + } + + /** + * Get the model property: The model of the storage appliance. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java new file mode 100644 index 000000000000..022873202656 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkInner.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked + * network. + */ +@Fluent +public final class TrunkedNetworkInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * TrunkedNetworkProperties represents properties of the trunked network. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private TrunkedNetworkProperties innerProperties = new TrunkedNetworkProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of TrunkedNetworkInner class. */ + public TrunkedNetworkInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the TrunkedNetworkInner object itself. + */ + public TrunkedNetworkInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: TrunkedNetworkProperties represents properties of the trunked network. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private TrunkedNetworkProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public TrunkedNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public TrunkedNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the detailedStatus property: The more detailed status of the trunked network. + * + * @return the detailedStatus value. + */ + public TrunkedNetworkDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this trunked network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksClustersAssociatedIds(); + } + + /** + * Get the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + public HybridAksPluginType hybridAksPluginType() { + return this.innerProperties() == null ? null : this.innerProperties().hybridAksPluginType(); + } + + /** + * Set the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @param hybridAksPluginType the hybridAksPluginType value to set. + * @return the TrunkedNetworkInner object itself. + */ + public TrunkedNetworkInner withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + if (this.innerProperties() == null) { + this.innerProperties = new TrunkedNetworkProperties(); + } + this.innerProperties().withHybridAksPluginType(hybridAksPluginType); + return this; + } + + /** + * Get the interfaceName property: The default interface name for this trunked network in the virtual machine. This + * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); + } + + /** + * Set the interfaceName property: The default interface name for this trunked network in the virtual machine. This + * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @param interfaceName the interfaceName value to set. + * @return the TrunkedNetworkInner object itself. + */ + public TrunkedNetworkInner withInterfaceName(String interfaceName) { + if (this.innerProperties() == null) { + this.innerProperties = new TrunkedNetworkProperties(); + } + this.innerProperties().withInterfaceName(interfaceName); + return this; + } + + /** + * Get the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. + * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * + * @return the isolationDomainIds value. + */ + public List isolationDomainIds() { + return this.innerProperties() == null ? null : this.innerProperties().isolationDomainIds(); + } + + /** + * Set the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. + * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * + * @param isolationDomainIds the isolationDomainIds value to set. + * @return the TrunkedNetworkInner object itself. + */ + public TrunkedNetworkInner withIsolationDomainIds(List isolationDomainIds) { + if (this.innerProperties() == null) { + this.innerProperties = new TrunkedNetworkProperties(); + } + this.innerProperties().withIsolationDomainIds(isolationDomainIds); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the trunked network. + * + * @return the provisioningState value. + */ + public TrunkedNetworkProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid AKS + * virtual machines, that are currently using this trunked network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachinesAssociatedIds(); + } + + /** + * Get the vlans property: The list of vlans that are selected from the isolation domains for trunking. + * + * @return the vlans value. + */ + public List vlans() { + return this.innerProperties() == null ? null : this.innerProperties().vlans(); + } + + /** + * Set the vlans property: The list of vlans that are selected from the isolation domains for trunking. + * + * @param vlans the vlans value to set. + * @return the TrunkedNetworkInner object itself. + */ + public TrunkedNetworkInner withVlans(List vlans) { + if (this.innerProperties() == null) { + this.innerProperties = new TrunkedNetworkProperties(); + } + this.innerProperties().withVlans(vlans); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model TrunkedNetworkInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model TrunkedNetworkInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TrunkedNetworkInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java new file mode 100644 index 000000000000..774d4274fbd1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/TrunkedNetworkProperties.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** TrunkedNetworkProperties represents properties of the trunked network. */ +@Fluent +public final class TrunkedNetworkProperties { + /* + * The resource ID of the Network Cloud cluster this trunked network is associated with. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The more detailed status of the trunked network. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private TrunkedNetworkDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The list of Hybrid AKS cluster resource IDs that are associated with this trunked network. + */ + @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List hybridAksClustersAssociatedIds; + + /* + * The network plugin type for Hybrid AKS. + */ + @JsonProperty(value = "hybridAksPluginType") + private HybridAksPluginType hybridAksPluginType; + + /* + * The default interface name for this trunked network in the virtual machine. This name can be overridden by the + * name supplied in the network attachment configuration of that virtual machine. + */ + @JsonProperty(value = "interfaceName") + private String interfaceName; + + /* + * The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of + * l2IsolationDomain and l3IsolationDomain resources. + */ + @JsonProperty(value = "isolationDomainIds", required = true) + private List isolationDomainIds; + + /* + * The provisioning state of the trunked network. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private TrunkedNetworkProvisioningState provisioningState; + + /* + * The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using + * this trunked network. + */ + @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY) + private List virtualMachinesAssociatedIds; + + /* + * The list of vlans that are selected from the isolation domains for trunking. + */ + @JsonProperty(value = "vlans", required = true) + private List vlans; + + /** Creates an instance of TrunkedNetworkProperties class. */ + public TrunkedNetworkProperties() { + } + + /** + * Get the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated with. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the detailedStatus property: The more detailed status of the trunked network. + * + * @return the detailedStatus value. + */ + public TrunkedNetworkDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this trunked network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + public List hybridAksClustersAssociatedIds() { + return this.hybridAksClustersAssociatedIds; + } + + /** + * Get the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + public HybridAksPluginType hybridAksPluginType() { + return this.hybridAksPluginType; + } + + /** + * Set the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @param hybridAksPluginType the hybridAksPluginType value to set. + * @return the TrunkedNetworkProperties object itself. + */ + public TrunkedNetworkProperties withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + this.hybridAksPluginType = hybridAksPluginType; + return this; + } + + /** + * Get the interfaceName property: The default interface name for this trunked network in the virtual machine. This + * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.interfaceName; + } + + /** + * Set the interfaceName property: The default interface name for this trunked network in the virtual machine. This + * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @param interfaceName the interfaceName value to set. + * @return the TrunkedNetworkProperties object itself. + */ + public TrunkedNetworkProperties withInterfaceName(String interfaceName) { + this.interfaceName = interfaceName; + return this; + } + + /** + * Get the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. + * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * + * @return the isolationDomainIds value. + */ + public List isolationDomainIds() { + return this.isolationDomainIds; + } + + /** + * Set the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. + * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * + * @param isolationDomainIds the isolationDomainIds value to set. + * @return the TrunkedNetworkProperties object itself. + */ + public TrunkedNetworkProperties withIsolationDomainIds(List isolationDomainIds) { + this.isolationDomainIds = isolationDomainIds; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the trunked network. + * + * @return the provisioningState value. + */ + public TrunkedNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid AKS + * virtual machines, that are currently using this trunked network. + * + * @return the virtualMachinesAssociatedIds value. + */ + public List virtualMachinesAssociatedIds() { + return this.virtualMachinesAssociatedIds; + } + + /** + * Get the vlans property: The list of vlans that are selected from the isolation domains for trunking. + * + * @return the vlans value. + */ + public List vlans() { + return this.vlans; + } + + /** + * Set the vlans property: The list of vlans that are selected from the isolation domains for trunking. + * + * @param vlans the vlans value to set. + * @return the TrunkedNetworkProperties object itself. + */ + public TrunkedNetworkProperties withVlans(List vlans) { + this.vlans = vlans; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (isolationDomainIds() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property isolationDomainIds in model TrunkedNetworkProperties")); + } + if (vlans() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property vlans in model TrunkedNetworkProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TrunkedNetworkProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java new file mode 100644 index 000000000000..9be2017cbfa0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineInner.java @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.azure.resourcemanager.networkcloud.models.StorageProfile; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineBootMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDeviceModelType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineIsolateEmulatorThread; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHint; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerState; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineProvisioningState; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVirtioInterfaceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** VirtualMachine represents the on-premises Network Cloud virtual machine. */ +@Fluent +public final class VirtualMachineInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * VirtualMachineProperties represents the properties of the virtual machine. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private VirtualMachineProperties innerProperties = new VirtualMachineProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VirtualMachineInner class. */ + public VirtualMachineInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: VirtualMachineProperties represents the properties of the virtual machine. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private VirtualMachineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VirtualMachineInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the adminUsername property: The name of the administrator to which the ssh public keys will be added into the + * authorized keys. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.innerProperties() == null ? null : this.innerProperties().adminUsername(); + } + + /** + * Set the adminUsername property: The name of the administrator to which the ssh public keys will be added into the + * authorized keys. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withAdminUsername(String adminUsername) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withAdminUsername(adminUsername); + return this; + } + + /** + * Get the bareMetalMachineId property: The resource ID of the bare metal machine the virtual machine has landed to. + * + * @return the bareMetalMachineId value. + */ + public String bareMetalMachineId() { + return this.innerProperties() == null ? null : this.innerProperties().bareMetalMachineId(); + } + + /** + * Get the bootMethod property: Selects the boot method for the virtual machine. + * + * @return the bootMethod value. + */ + public VirtualMachineBootMethod bootMethod() { + return this.innerProperties() == null ? null : this.innerProperties().bootMethod(); + } + + /** + * Set the bootMethod property: Selects the boot method for the virtual machine. + * + * @param bootMethod the bootMethod value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withBootMethod(VirtualMachineBootMethod bootMethod) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withBootMethod(bootMethod); + return this; + } + + /** + * Get the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. + * + *

The cloud service network that provides platform-level services for the virtual machine. + * + * @return the cloudServicesNetworkAttachment value. + */ + public NetworkAttachment cloudServicesNetworkAttachment() { + return this.innerProperties() == null ? null : this.innerProperties().cloudServicesNetworkAttachment(); + } + + /** + * Set the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. + * + *

The cloud service network that provides platform-level services for the virtual machine. + * + * @param cloudServicesNetworkAttachment the cloudServicesNetworkAttachment value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withCloudServicesNetworkAttachment(NetworkAttachment cloudServicesNetworkAttachment) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withCloudServicesNetworkAttachment(cloudServicesNetworkAttachment); + return this; + } + + /** + * Get the clusterId property: The resource ID of the cluster the virtual machine is created for. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().clusterId(); + } + + /** + * Get the cpuCores property: The number of CPU cores in the virtual machine. + * + * @return the cpuCores value. + */ + public long cpuCores() { + return this.innerProperties() == null ? 0L : this.innerProperties().cpuCores(); + } + + /** + * Set the cpuCores property: The number of CPU cores in the virtual machine. + * + * @param cpuCores the cpuCores value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withCpuCores(long cpuCores) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withCpuCores(cpuCores); + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the virtual machine. + * + * @return the detailedStatus value. + */ + public VirtualMachineDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of + * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. + * + * @return the isolateEmulatorThread value. + */ + public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { + return this.innerProperties() == null ? null : this.innerProperties().isolateEmulatorThread(); + } + + /** + * Set the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of + * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. + * + * @param isolateEmulatorThread the isolateEmulatorThread value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withIsolateEmulatorThread(VirtualMachineIsolateEmulatorThread isolateEmulatorThread) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withIsolateEmulatorThread(isolateEmulatorThread); + return this; + } + + /** + * Get the memorySizeGB property: The memory size of the virtual machine in GB. + * + * @return the memorySizeGB value. + */ + public long memorySizeGB() { + return this.innerProperties() == null ? 0L : this.innerProperties().memorySizeGB(); + } + + /** + * Set the memorySizeGB property: The memory size of the virtual machine in GB. + * + * @param memorySizeGB the memorySizeGB value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withMemorySizeGB(long memorySizeGB) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withMemorySizeGB(memorySizeGB); + return this; + } + + /** + * Get the networkAttachments property: The list of network attachments to the virtual machine. + * + * @return the networkAttachments value. + */ + public List networkAttachments() { + return this.innerProperties() == null ? null : this.innerProperties().networkAttachments(); + } + + /** + * Set the networkAttachments property: The list of network attachments to the virtual machine. + * + * @param networkAttachments the networkAttachments value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withNetworkAttachments(List networkAttachments) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withNetworkAttachments(networkAttachments); + return this; + } + + /** + * Get the networkData property: The Base64 encoded cloud-init network data. + * + * @return the networkData value. + */ + public String networkData() { + return this.innerProperties() == null ? null : this.innerProperties().networkData(); + } + + /** + * Set the networkData property: The Base64 encoded cloud-init network data. + * + * @param networkData the networkData value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withNetworkData(String networkData) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withNetworkData(networkData); + return this; + } + + /** + * Get the placementHints property: The scheduling hints for the virtual machine. + * + * @return the placementHints value. + */ + public List placementHints() { + return this.innerProperties() == null ? null : this.innerProperties().placementHints(); + } + + /** + * Set the placementHints property: The scheduling hints for the virtual machine. + * + * @param placementHints the placementHints value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withPlacementHints(List placementHints) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withPlacementHints(placementHints); + return this; + } + + /** + * Get the powerState property: The power state of the virtual machine. + * + * @return the powerState value. + */ + public VirtualMachinePowerState powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual machine. + * + * @return the provisioningState value. + */ + public VirtualMachineProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using + * the cloud-init ssh_authorized_keys mechanism for the adminUsername. + * + * @return the sshPublicKeys value. + */ + public List sshPublicKeys() { + return this.innerProperties() == null ? null : this.innerProperties().sshPublicKeys(); + } + + /** + * Set the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using + * the cloud-init ssh_authorized_keys mechanism for the adminUsername. + * + * @param sshPublicKeys the sshPublicKeys value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withSshPublicKeys(List sshPublicKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withSshPublicKeys(sshPublicKeys); + return this; + } + + /** + * Get the storageProfile property: StorageProfile represents information about a disk. + * + *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); + } + + /** + * Set the storageProfile property: StorageProfile represents information about a disk. + * + *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withStorageProfile(storageProfile); + return this; + } + + /** + * Get the userData property: The Base64 encoded cloud-init user data. + * + * @return the userData value. + */ + public String userData() { + return this.innerProperties() == null ? null : this.innerProperties().userData(); + } + + /** + * Set the userData property: The Base64 encoded cloud-init user data. + * + * @param userData the userData value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withUserData(String userData) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withUserData(userData); + return this; + } + + /** + * Get the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio + * interface. + * + * @return the virtioInterface value. + */ + public VirtualMachineVirtioInterfaceType virtioInterface() { + return this.innerProperties() == null ? null : this.innerProperties().virtioInterface(); + } + + /** + * Set the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio + * interface. + * + * @param virtioInterface the virtioInterface value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVirtioInterface(VirtualMachineVirtioInterfaceType virtioInterface) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withVirtioInterface(virtioInterface); + return this; + } + + /** + * Get the vmDeviceModel property: The type of the device model to use. + * + * @return the vmDeviceModel value. + */ + public VirtualMachineDeviceModelType vmDeviceModel() { + return this.innerProperties() == null ? null : this.innerProperties().vmDeviceModel(); + } + + /** + * Set the vmDeviceModel property: The type of the device model to use. + * + * @param vmDeviceModel the vmDeviceModel value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVmDeviceModel(VirtualMachineDeviceModelType vmDeviceModel) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withVmDeviceModel(vmDeviceModel); + return this; + } + + /** + * Get the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full + * url and tag notation used to pull the image. + * + * @return the vmImage value. + */ + public String vmImage() { + return this.innerProperties() == null ? null : this.innerProperties().vmImage(); + } + + /** + * Set the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full + * url and tag notation used to pull the image. + * + * @param vmImage the vmImage value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVmImage(String vmImage) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withVmImage(vmImage); + return this; + } + + /** + * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @return the vmImageRepositoryCredentials value. + */ + public ImageRepositoryCredentials vmImageRepositoryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().vmImageRepositoryCredentials(); + } + + /** + * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. + * @return the VirtualMachineInner object itself. + */ + public VirtualMachineInner withVmImageRepositoryCredentials( + ImageRepositoryCredentials vmImageRepositoryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachineProperties(); + } + this.innerProperties().withVmImageRepositoryCredentials(vmImageRepositoryCredentials); + return this; + } + + /** + * Get the volumes property: The resource IDs of volumes that are attached to the virtual machine. + * + * @return the volumes value. + */ + public List volumes() { + return this.innerProperties() == null ? null : this.innerProperties().volumes(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property extendedLocation in model VirtualMachineInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model VirtualMachineInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java new file mode 100644 index 000000000000..ef7435221b34 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachinePatchProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. */ +@Fluent +public final class VirtualMachinePatchProperties { + /* + * ImageRepositoryCredentials represents the credentials used to login to the image repository. + * + * The credentials used to login to the image repository that has access to the specified image. + */ + @JsonProperty(value = "vmImageRepositoryCredentials") + private ImageRepositoryCredentials vmImageRepositoryCredentials; + + /** Creates an instance of VirtualMachinePatchProperties class. */ + public VirtualMachinePatchProperties() { + } + + /** + * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @return the vmImageRepositoryCredentials value. + */ + public ImageRepositoryCredentials vmImageRepositoryCredentials() { + return this.vmImageRepositoryCredentials; + } + + /** + * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. + * @return the VirtualMachinePatchProperties object itself. + */ + public VirtualMachinePatchProperties withVmImageRepositoryCredentials( + ImageRepositoryCredentials vmImageRepositoryCredentials) { + this.vmImageRepositoryCredentials = vmImageRepositoryCredentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmImageRepositoryCredentials() != null) { + vmImageRepositoryCredentials().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java new file mode 100644 index 000000000000..ec6dcee2c99c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VirtualMachineProperties.java @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.azure.resourcemanager.networkcloud.models.StorageProfile; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineBootMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDeviceModelType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineIsolateEmulatorThread; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHint; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerState; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineProvisioningState; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVirtioInterfaceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualMachineProperties represents the properties of the virtual machine. */ +@Fluent +public final class VirtualMachineProperties { + /* + * The name of the administrator to which the ssh public keys will be added into the authorized keys. + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /* + * The resource ID of the bare metal machine the virtual machine has landed to. + */ + @JsonProperty(value = "bareMetalMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String bareMetalMachineId; + + /* + * Selects the boot method for the virtual machine. + */ + @JsonProperty(value = "bootMethod") + private VirtualMachineBootMethod bootMethod; + + /* + * NetworkAttachment represents the single network attachment. + * + * The cloud service network that provides platform-level services for the virtual machine. + */ + @JsonProperty(value = "cloudServicesNetworkAttachment", required = true) + private NetworkAttachment cloudServicesNetworkAttachment; + + /* + * The resource ID of the cluster the virtual machine is created for. + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /* + * The number of CPU cores in the virtual machine. + */ + @JsonProperty(value = "cpuCores", required = true) + private long cpuCores; + + /* + * The more detailed status of the virtual machine. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores + * is isolated to run the emulator thread for this virtual machine. + */ + @JsonProperty(value = "isolateEmulatorThread") + private VirtualMachineIsolateEmulatorThread isolateEmulatorThread; + + /* + * The memory size of the virtual machine in GB. + */ + @JsonProperty(value = "memorySizeGB", required = true) + private long memorySizeGB; + + /* + * The list of network attachments to the virtual machine. + */ + @JsonProperty(value = "networkAttachments") + private List networkAttachments; + + /* + * The Base64 encoded cloud-init network data. + */ + @JsonProperty(value = "networkData") + private String networkData; + + /* + * The scheduling hints for the virtual machine. + */ + @JsonProperty(value = "placementHints") + private List placementHints; + + /* + * The power state of the virtual machine. + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachinePowerState powerState; + + /* + * The provisioning state of the virtual machine. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private VirtualMachineProvisioningState provisioningState; + + /* + * The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init + * ssh_authorized_keys mechanism for the adminUsername. + */ + @JsonProperty(value = "sshPublicKeys") + private List sshPublicKeys; + + /* + * StorageProfile represents information about a disk. + * + * The storage profile that specifies size and other parameters about the disks related to the virtual machine. + */ + @JsonProperty(value = "storageProfile", required = true) + private StorageProfile storageProfile; + + /* + * The Base64 encoded cloud-init user data. + */ + @JsonProperty(value = "userData") + private String userData; + + /* + * Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + */ + @JsonProperty(value = "virtioInterface") + private VirtualMachineVirtioInterfaceType virtioInterface; + + /* + * The type of the device model to use. + */ + @JsonProperty(value = "vmDeviceModel") + private VirtualMachineDeviceModelType vmDeviceModel; + + /* + * The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used + * to pull the image. + */ + @JsonProperty(value = "vmImage", required = true) + private String vmImage; + + /* + * ImageRepositoryCredentials represents the credentials used to login to the image repository. + * + * The credentials used to login to the image repository that has access to the specified image. + */ + @JsonProperty(value = "vmImageRepositoryCredentials") + private ImageRepositoryCredentials vmImageRepositoryCredentials; + + /* + * The resource IDs of volumes that are attached to the virtual machine. + */ + @JsonProperty(value = "volumes", access = JsonProperty.Access.WRITE_ONLY) + private List volumes; + + /** Creates an instance of VirtualMachineProperties class. */ + public VirtualMachineProperties() { + } + + /** + * Get the adminUsername property: The name of the administrator to which the ssh public keys will be added into the + * authorized keys. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: The name of the administrator to which the ssh public keys will be added into the + * authorized keys. + * + * @param adminUsername the adminUsername value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the bareMetalMachineId property: The resource ID of the bare metal machine the virtual machine has landed to. + * + * @return the bareMetalMachineId value. + */ + public String bareMetalMachineId() { + return this.bareMetalMachineId; + } + + /** + * Get the bootMethod property: Selects the boot method for the virtual machine. + * + * @return the bootMethod value. + */ + public VirtualMachineBootMethod bootMethod() { + return this.bootMethod; + } + + /** + * Set the bootMethod property: Selects the boot method for the virtual machine. + * + * @param bootMethod the bootMethod value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withBootMethod(VirtualMachineBootMethod bootMethod) { + this.bootMethod = bootMethod; + return this; + } + + /** + * Get the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. + * + *

The cloud service network that provides platform-level services for the virtual machine. + * + * @return the cloudServicesNetworkAttachment value. + */ + public NetworkAttachment cloudServicesNetworkAttachment() { + return this.cloudServicesNetworkAttachment; + } + + /** + * Set the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. + * + *

The cloud service network that provides platform-level services for the virtual machine. + * + * @param cloudServicesNetworkAttachment the cloudServicesNetworkAttachment value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withCloudServicesNetworkAttachment( + NetworkAttachment cloudServicesNetworkAttachment) { + this.cloudServicesNetworkAttachment = cloudServicesNetworkAttachment; + return this; + } + + /** + * Get the clusterId property: The resource ID of the cluster the virtual machine is created for. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the cpuCores property: The number of CPU cores in the virtual machine. + * + * @return the cpuCores value. + */ + public long cpuCores() { + return this.cpuCores; + } + + /** + * Set the cpuCores property: The number of CPU cores in the virtual machine. + * + * @param cpuCores the cpuCores value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withCpuCores(long cpuCores) { + this.cpuCores = cpuCores; + return this; + } + + /** + * Get the detailedStatus property: The more detailed status of the virtual machine. + * + * @return the detailedStatus value. + */ + public VirtualMachineDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of + * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. + * + * @return the isolateEmulatorThread value. + */ + public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { + return this.isolateEmulatorThread; + } + + /** + * Set the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator of + * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. + * + * @param isolateEmulatorThread the isolateEmulatorThread value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withIsolateEmulatorThread( + VirtualMachineIsolateEmulatorThread isolateEmulatorThread) { + this.isolateEmulatorThread = isolateEmulatorThread; + return this; + } + + /** + * Get the memorySizeGB property: The memory size of the virtual machine in GB. + * + * @return the memorySizeGB value. + */ + public long memorySizeGB() { + return this.memorySizeGB; + } + + /** + * Set the memorySizeGB property: The memory size of the virtual machine in GB. + * + * @param memorySizeGB the memorySizeGB value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withMemorySizeGB(long memorySizeGB) { + this.memorySizeGB = memorySizeGB; + return this; + } + + /** + * Get the networkAttachments property: The list of network attachments to the virtual machine. + * + * @return the networkAttachments value. + */ + public List networkAttachments() { + return this.networkAttachments; + } + + /** + * Set the networkAttachments property: The list of network attachments to the virtual machine. + * + * @param networkAttachments the networkAttachments value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withNetworkAttachments(List networkAttachments) { + this.networkAttachments = networkAttachments; + return this; + } + + /** + * Get the networkData property: The Base64 encoded cloud-init network data. + * + * @return the networkData value. + */ + public String networkData() { + return this.networkData; + } + + /** + * Set the networkData property: The Base64 encoded cloud-init network data. + * + * @param networkData the networkData value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withNetworkData(String networkData) { + this.networkData = networkData; + return this; + } + + /** + * Get the placementHints property: The scheduling hints for the virtual machine. + * + * @return the placementHints value. + */ + public List placementHints() { + return this.placementHints; + } + + /** + * Set the placementHints property: The scheduling hints for the virtual machine. + * + * @param placementHints the placementHints value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withPlacementHints(List placementHints) { + this.placementHints = placementHints; + return this; + } + + /** + * Get the powerState property: The power state of the virtual machine. + * + * @return the powerState value. + */ + public VirtualMachinePowerState powerState() { + return this.powerState; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual machine. + * + * @return the provisioningState value. + */ + public VirtualMachineProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using + * the cloud-init ssh_authorized_keys mechanism for the adminUsername. + * + * @return the sshPublicKeys value. + */ + public List sshPublicKeys() { + return this.sshPublicKeys; + } + + /** + * Set the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using + * the cloud-init ssh_authorized_keys mechanism for the adminUsername. + * + * @param sshPublicKeys the sshPublicKeys value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withSshPublicKeys(List sshPublicKeys) { + this.sshPublicKeys = sshPublicKeys; + return this; + } + + /** + * Get the storageProfile property: StorageProfile represents information about a disk. + * + *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: StorageProfile represents information about a disk. + * + *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the userData property: The Base64 encoded cloud-init user data. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: The Base64 encoded cloud-init user data. + * + * @param userData the userData value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio + * interface. + * + * @return the virtioInterface value. + */ + public VirtualMachineVirtioInterfaceType virtioInterface() { + return this.virtioInterface; + } + + /** + * Set the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio + * interface. + * + * @param virtioInterface the virtioInterface value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withVirtioInterface(VirtualMachineVirtioInterfaceType virtioInterface) { + this.virtioInterface = virtioInterface; + return this; + } + + /** + * Get the vmDeviceModel property: The type of the device model to use. + * + * @return the vmDeviceModel value. + */ + public VirtualMachineDeviceModelType vmDeviceModel() { + return this.vmDeviceModel; + } + + /** + * Set the vmDeviceModel property: The type of the device model to use. + * + * @param vmDeviceModel the vmDeviceModel value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withVmDeviceModel(VirtualMachineDeviceModelType vmDeviceModel) { + this.vmDeviceModel = vmDeviceModel; + return this; + } + + /** + * Get the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full + * url and tag notation used to pull the image. + * + * @return the vmImage value. + */ + public String vmImage() { + return this.vmImage; + } + + /** + * Set the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full + * url and tag notation used to pull the image. + * + * @param vmImage the vmImage value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withVmImage(String vmImage) { + this.vmImage = vmImage; + return this; + } + + /** + * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @return the vmImageRepositoryCredentials value. + */ + public ImageRepositoryCredentials vmImageRepositoryCredentials() { + return this.vmImageRepositoryCredentials; + } + + /** + * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. + * @return the VirtualMachineProperties object itself. + */ + public VirtualMachineProperties withVmImageRepositoryCredentials( + ImageRepositoryCredentials vmImageRepositoryCredentials) { + this.vmImageRepositoryCredentials = vmImageRepositoryCredentials; + return this; + } + + /** + * Get the volumes property: The resource IDs of volumes that are attached to the virtual machine. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminUsername() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminUsername in model VirtualMachineProperties")); + } + if (cloudServicesNetworkAttachment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property cloudServicesNetworkAttachment in model VirtualMachineProperties")); + } else { + cloudServicesNetworkAttachment().validate(); + } + if (networkAttachments() != null) { + networkAttachments().forEach(e -> e.validate()); + } + if (placementHints() != null) { + placementHints().forEach(e -> e.validate()); + } + if (sshPublicKeys() != null) { + sshPublicKeys().forEach(e -> e.validate()); + } + if (storageProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageProfile in model VirtualMachineProperties")); + } else { + storageProfile().validate(); + } + if (vmImage() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmImage in model VirtualMachineProperties")); + } + if (vmImageRepositoryCredentials() != null) { + vmImageRepositoryCredentials().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineProperties.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java new file mode 100644 index 000000000000..18c953b968cc --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeInner.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.VolumeDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.VolumeProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Volume represents storage made available for use by resources running on the cluster. */ +@Fluent +public final class VolumeInner extends Resource { + /* + * ExtendedLocation represents the Azure custom location where the resource will be created. + * + * The extended location of the cluster associated with the resource. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * VolumeProperties represents properties of the volume resource. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties", required = true) + private VolumeProperties innerProperties = new VolumeProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of VolumeInner class. */ + public VolumeInner() { + } + + /** + * Get the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: VolumeProperties represents properties of the volume resource. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private VolumeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VolumeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the attachedTo property: The list of resource IDs that attach the volume. It may include virtual machines and + * Hybrid AKS clusters. + * + * @return the attachedTo value. + */ + public List attachedTo() { + return this.innerProperties() == null ? null : this.innerProperties().attachedTo(); + } + + /** + * Get the detailedStatus property: The more detailed status of the volume. + * + * @return the detailedStatus value. + */ + public VolumeDetailedStatus detailedStatus() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatus(); + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.innerProperties() == null ? null : this.innerProperties().detailedStatusMessage(); + } + + /** + * Get the provisioningState property: The provisioning state of the volume. + * + * @return the provisioningState value. + */ + public VolumeProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the serialNumber property: The unique identifier of the volume. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Get the sizeMiB property: The size of the allocation for this volume in Mebibytes. + * + * @return the sizeMiB value. + */ + public long sizeMiB() { + return this.innerProperties() == null ? 0L : this.innerProperties().sizeMiB(); + } + + /** + * Set the sizeMiB property: The size of the allocation for this volume in Mebibytes. + * + * @param sizeMiB the sizeMiB value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withSizeMiB(long sizeMiB) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeProperties(); + } + this.innerProperties().withSizeMiB(sizeMiB); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model VolumeInner")); + } else { + extendedLocation().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model VolumeInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeInner.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java new file mode 100644 index 000000000000..ecce0afe0170 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/VolumeProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.models.VolumeDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.VolumeProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VolumeProperties represents properties of the volume resource. */ +@Fluent +public final class VolumeProperties { + /* + * The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + */ + @JsonProperty(value = "attachedTo", access = JsonProperty.Access.WRITE_ONLY) + private List attachedTo; + + /* + * The more detailed status of the volume. + */ + @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY) + private VolumeDetailedStatus detailedStatus; + + /* + * The descriptive message about the current detailed status. + */ + @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String detailedStatusMessage; + + /* + * The provisioning state of the volume. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private VolumeProvisioningState provisioningState; + + /* + * The unique identifier of the volume. + */ + @JsonProperty(value = "serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * The size of the allocation for this volume in Mebibytes. + */ + @JsonProperty(value = "sizeMiB", required = true) + private long sizeMiB; + + /** Creates an instance of VolumeProperties class. */ + public VolumeProperties() { + } + + /** + * Get the attachedTo property: The list of resource IDs that attach the volume. It may include virtual machines and + * Hybrid AKS clusters. + * + * @return the attachedTo value. + */ + public List attachedTo() { + return this.attachedTo; + } + + /** + * Get the detailedStatus property: The more detailed status of the volume. + * + * @return the detailedStatus value. + */ + public VolumeDetailedStatus detailedStatus() { + return this.detailedStatus; + } + + /** + * Get the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + public String detailedStatusMessage() { + return this.detailedStatusMessage; + } + + /** + * Get the provisioningState property: The provisioning state of the volume. + * + * @return the provisioningState value. + */ + public VolumeProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the serialNumber property: The unique identifier of the volume. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the sizeMiB property: The size of the allocation for this volume in Mebibytes. + * + * @return the sizeMiB value. + */ + public long sizeMiB() { + return this.sizeMiB; + } + + /** + * Set the sizeMiB property: The size of the allocation for this volume in Mebibytes. + * + * @param sizeMiB the sizeMiB value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withSizeMiB(long sizeMiB) { + this.sizeMiB = sizeMiB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java new file mode 100644 index 000000000000..0a30acf3f8ac --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for NetworkCloud. The Network Cloud APIs provide management of the + * on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and + * more. + */ +package com.azure.resourcemanager.networkcloud.fluent.models; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java new file mode 100644 index 000000000000..f30dbf227aee --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for NetworkCloud. The Network Cloud APIs provide management of the on-premises + * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + */ +package com.azure.resourcemanager.networkcloud.fluent; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java new file mode 100644 index 000000000000..b180b8bb3e61 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineImpl.java @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner; +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachine; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePatchParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineProvisioningState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReadyState; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineValidateHardwareParameters; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HardwareInventory; +import com.azure.resourcemanager.networkcloud.models.HardwareValidationStatus; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BareMetalMachineImpl + implements BareMetalMachine, BareMetalMachine.Definition, BareMetalMachine.Update { + private BareMetalMachineInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String bmcConnectionString() { + return this.innerModel().bmcConnectionString(); + } + + public AdministrativeCredentials bmcCredentials() { + return this.innerModel().bmcCredentials(); + } + + public String bmcMacAddress() { + return this.innerModel().bmcMacAddress(); + } + + public String bootMacAddress() { + return this.innerModel().bootMacAddress(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public BareMetalMachineCordonStatus cordonStatus() { + return this.innerModel().cordonStatus(); + } + + public BareMetalMachineDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public HardwareInventory hardwareInventory() { + return this.innerModel().hardwareInventory(); + } + + public HardwareValidationStatus hardwareValidationStatus() { + return this.innerModel().hardwareValidationStatus(); + } + + public List hybridAksClustersAssociatedIds() { + List inner = this.innerModel().hybridAksClustersAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String kubernetesNodeName() { + return this.innerModel().kubernetesNodeName(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public String machineDetails() { + return this.innerModel().machineDetails(); + } + + public String machineName() { + return this.innerModel().machineName(); + } + + public String machineSkuId() { + return this.innerModel().machineSkuId(); + } + + public String oamIpv4Address() { + return this.innerModel().oamIpv4Address(); + } + + public String oamIpv6Address() { + return this.innerModel().oamIpv6Address(); + } + + public String osImage() { + return this.innerModel().osImage(); + } + + public BareMetalMachinePowerState powerState() { + return this.innerModel().powerState(); + } + + public BareMetalMachineProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String rackId() { + return this.innerModel().rackId(); + } + + public long rackSlot() { + return this.innerModel().rackSlot(); + } + + public BareMetalMachineReadyState readyState() { + return this.innerModel().readyState(); + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public String serviceTag() { + return this.innerModel().serviceTag(); + } + + public List virtualMachinesAssociatedIds() { + List inner = this.innerModel().virtualMachinesAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BareMetalMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String bareMetalMachineName; + + private BareMetalMachinePatchParameters updateBareMetalMachineUpdateParameters; + + public BareMetalMachineImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public BareMetalMachine create() { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachines() + .createOrUpdate(resourceGroupName, bareMetalMachineName, this.innerModel(), Context.NONE); + return this; + } + + public BareMetalMachine create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachines() + .createOrUpdate(resourceGroupName, bareMetalMachineName, this.innerModel(), context); + return this; + } + + BareMetalMachineImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new BareMetalMachineInner(); + this.serviceManager = serviceManager; + this.bareMetalMachineName = name; + } + + public BareMetalMachineImpl update() { + this.updateBareMetalMachineUpdateParameters = new BareMetalMachinePatchParameters(); + return this; + } + + public BareMetalMachine apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachines() + .update(resourceGroupName, bareMetalMachineName, updateBareMetalMachineUpdateParameters, Context.NONE); + return this; + } + + public BareMetalMachine apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachines() + .update(resourceGroupName, bareMetalMachineName, updateBareMetalMachineUpdateParameters, context); + return this; + } + + BareMetalMachineImpl( + BareMetalMachineInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.bareMetalMachineName = Utils.getValueFromIdByName(innerObject.id(), "bareMetalMachines"); + } + + public BareMetalMachine refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachines() + .getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, Context.NONE) + .getValue(); + return this; + } + + public BareMetalMachine refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachines() + .getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, context) + .getValue(); + return this; + } + + public void cordon() { + serviceManager.bareMetalMachines().cordon(resourceGroupName, bareMetalMachineName); + } + + public void cordon(BareMetalMachineCordonParameters bareMetalMachineCordonParameters, Context context) { + serviceManager + .bareMetalMachines() + .cordon(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters, context); + } + + public void powerOff() { + serviceManager.bareMetalMachines().powerOff(resourceGroupName, bareMetalMachineName); + } + + public void powerOff(BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, Context context) { + serviceManager + .bareMetalMachines() + .powerOff(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters, context); + } + + public void reimage() { + serviceManager.bareMetalMachines().reimage(resourceGroupName, bareMetalMachineName); + } + + public void reimage(Context context) { + serviceManager.bareMetalMachines().reimage(resourceGroupName, bareMetalMachineName, context); + } + + public void replace() { + serviceManager.bareMetalMachines().replace(resourceGroupName, bareMetalMachineName); + } + + public void replace(BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, Context context) { + serviceManager + .bareMetalMachines() + .replace(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters, context); + } + + public void restart() { + serviceManager.bareMetalMachines().restart(resourceGroupName, bareMetalMachineName); + } + + public void restart(Context context) { + serviceManager.bareMetalMachines().restart(resourceGroupName, bareMetalMachineName, context); + } + + public void runCommand(BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + serviceManager + .bareMetalMachines() + .runCommand(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters); + } + + public void runCommand(BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, Context context) { + serviceManager + .bareMetalMachines() + .runCommand(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, context); + } + + public void runDataExtracts(BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + serviceManager + .bareMetalMachines() + .runDataExtracts(resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters); + } + + public void runDataExtracts( + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, Context context) { + serviceManager + .bareMetalMachines() + .runDataExtracts( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, context); + } + + public void runReadCommands(BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + serviceManager + .bareMetalMachines() + .runReadCommands(resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters); + } + + public void runReadCommands( + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, Context context) { + serviceManager + .bareMetalMachines() + .runReadCommands( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, context); + } + + public void start() { + serviceManager.bareMetalMachines().start(resourceGroupName, bareMetalMachineName); + } + + public void start(Context context) { + serviceManager.bareMetalMachines().start(resourceGroupName, bareMetalMachineName, context); + } + + public void uncordon() { + serviceManager.bareMetalMachines().uncordon(resourceGroupName, bareMetalMachineName); + } + + public void uncordon(Context context) { + serviceManager.bareMetalMachines().uncordon(resourceGroupName, bareMetalMachineName, context); + } + + public void validateHardware( + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + serviceManager + .bareMetalMachines() + .validateHardware(resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters); + } + + public void validateHardware( + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, Context context) { + serviceManager + .bareMetalMachines() + .validateHardware( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, context); + } + + public BareMetalMachineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BareMetalMachineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BareMetalMachineImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public BareMetalMachineImpl withBmcConnectionString(String bmcConnectionString) { + this.innerModel().withBmcConnectionString(bmcConnectionString); + return this; + } + + public BareMetalMachineImpl withBmcCredentials(AdministrativeCredentials bmcCredentials) { + this.innerModel().withBmcCredentials(bmcCredentials); + return this; + } + + public BareMetalMachineImpl withBmcMacAddress(String bmcMacAddress) { + this.innerModel().withBmcMacAddress(bmcMacAddress); + return this; + } + + public BareMetalMachineImpl withBootMacAddress(String bootMacAddress) { + this.innerModel().withBootMacAddress(bootMacAddress); + return this; + } + + public BareMetalMachineImpl withMachineDetails(String machineDetails) { + if (isInCreateMode()) { + this.innerModel().withMachineDetails(machineDetails); + return this; + } else { + this.updateBareMetalMachineUpdateParameters.withMachineDetails(machineDetails); + return this; + } + } + + public BareMetalMachineImpl withMachineName(String machineName) { + this.innerModel().withMachineName(machineName); + return this; + } + + public BareMetalMachineImpl withMachineSkuId(String machineSkuId) { + this.innerModel().withMachineSkuId(machineSkuId); + return this; + } + + public BareMetalMachineImpl withRackId(String rackId) { + this.innerModel().withRackId(rackId); + return this; + } + + public BareMetalMachineImpl withRackSlot(long rackSlot) { + this.innerModel().withRackSlot(rackSlot); + return this; + } + + public BareMetalMachineImpl withSerialNumber(String serialNumber) { + this.innerModel().withSerialNumber(serialNumber); + return this; + } + + public BareMetalMachineImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBareMetalMachineUpdateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java new file mode 100644 index 000000000000..39c8981c8fde --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySet; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPatchParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BareMetalMachineKeySetImpl + implements BareMetalMachineKeySet, BareMetalMachineKeySet.Definition, BareMetalMachineKeySet.Update { + private BareMetalMachineKeySetInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String azureGroupId() { + return this.innerModel().azureGroupId(); + } + + public BareMetalMachineKeySetDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public OffsetDateTime expiration() { + return this.innerModel().expiration(); + } + + public List jumpHostsAllowed() { + List inner = this.innerModel().jumpHostsAllowed(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime lastValidation() { + return this.innerModel().lastValidation(); + } + + public String osGroupName() { + return this.innerModel().osGroupName(); + } + + public BareMetalMachineKeySetPrivilegeLevel privilegeLevel() { + return this.innerModel().privilegeLevel(); + } + + public BareMetalMachineKeySetProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List userList() { + List inner = this.innerModel().userList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List userListStatus() { + List inner = this.innerModel().userListStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BareMetalMachineKeySetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String bareMetalMachineKeySetName; + + private BareMetalMachineKeySetPatchParameters updateBareMetalMachineKeySetUpdateParameters; + + public BareMetalMachineKeySetImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public BareMetalMachineKeySet create() { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachineKeySets() + .createOrUpdate( + resourceGroupName, clusterName, bareMetalMachineKeySetName, this.innerModel(), Context.NONE); + return this; + } + + public BareMetalMachineKeySet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachineKeySets() + .createOrUpdate(resourceGroupName, clusterName, bareMetalMachineKeySetName, this.innerModel(), context); + return this; + } + + BareMetalMachineKeySetImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new BareMetalMachineKeySetInner(); + this.serviceManager = serviceManager; + this.bareMetalMachineKeySetName = name; + } + + public BareMetalMachineKeySetImpl update() { + this.updateBareMetalMachineKeySetUpdateParameters = new BareMetalMachineKeySetPatchParameters(); + return this; + } + + public BareMetalMachineKeySet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachineKeySets() + .update( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + updateBareMetalMachineKeySetUpdateParameters, + Context.NONE); + return this; + } + + public BareMetalMachineKeySet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachineKeySets() + .update( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + updateBareMetalMachineKeySetUpdateParameters, + context); + return this; + } + + BareMetalMachineKeySetImpl( + BareMetalMachineKeySetInner innerObject, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.bareMetalMachineKeySetName = Utils.getValueFromIdByName(innerObject.id(), "bareMetalMachineKeySets"); + } + + public BareMetalMachineKeySet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachineKeySets() + .getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, Context.NONE) + .getValue(); + return this; + } + + public BareMetalMachineKeySet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBareMetalMachineKeySets() + .getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, context) + .getValue(); + return this; + } + + public BareMetalMachineKeySetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BareMetalMachineKeySetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BareMetalMachineKeySetImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public BareMetalMachineKeySetImpl withAzureGroupId(String azureGroupId) { + this.innerModel().withAzureGroupId(azureGroupId); + return this; + } + + public BareMetalMachineKeySetImpl withExpiration(OffsetDateTime expiration) { + if (isInCreateMode()) { + this.innerModel().withExpiration(expiration); + return this; + } else { + this.updateBareMetalMachineKeySetUpdateParameters.withExpiration(expiration); + return this; + } + } + + public BareMetalMachineKeySetImpl withJumpHostsAllowed(List jumpHostsAllowed) { + if (isInCreateMode()) { + this.innerModel().withJumpHostsAllowed(jumpHostsAllowed); + return this; + } else { + this.updateBareMetalMachineKeySetUpdateParameters.withJumpHostsAllowed(jumpHostsAllowed); + return this; + } + } + + public BareMetalMachineKeySetImpl withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel privilegeLevel) { + this.innerModel().withPrivilegeLevel(privilegeLevel); + return this; + } + + public BareMetalMachineKeySetImpl withUserList(List userList) { + if (isInCreateMode()) { + this.innerModel().withUserList(userList); + return this; + } else { + this.updateBareMetalMachineKeySetUpdateParameters.withUserList(userList); + return this; + } + } + + public BareMetalMachineKeySetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBareMetalMachineKeySetUpdateParameters.withTags(tags); + return this; + } + } + + public BareMetalMachineKeySetImpl withOsGroupName(String osGroupName) { + this.innerModel().withOsGroupName(osGroupName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java new file mode 100644 index 000000000000..cb55d3a6804c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsClientImpl.java @@ -0,0 +1,1704 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.BareMetalMachineKeySetsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetList; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPatchParameters; +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 BareMetalMachineKeySetsClient. */ +public final class BareMetalMachineKeySetsClientImpl implements BareMetalMachineKeySetsClient { + /** The proxy service used to perform REST calls. */ + private final BareMetalMachineKeySetsService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of BareMetalMachineKeySetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BareMetalMachineKeySetsClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy + .create(BareMetalMachineKeySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudBareMetalMachineKeySets to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudBareMeta") + public interface BareMetalMachineKeySetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bareMetalMachineKeySetName") String bareMetalMachineKeySetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bareMetalMachineKeySetName") String bareMetalMachineKeySetName, + @BodyParam("application/json") BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bareMetalMachineKeySetName") String bareMetalMachineKeySetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bareMetalMachineKeySetName") String bareMetalMachineKeySetName, + @BodyParam("application/json") BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 list of bare metal machine key sets of the cluster in the provided resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, clusterName)); + } + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, clusterName, context)); + } + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + accept, + context); + } + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + return getWithResponseAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context).block(); + } + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineKeySetInner get( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + return getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, Context.NONE).getValue(); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters) { + 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + if (bareMetalMachineKeySetParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetParameters is required and cannot be null.")); + } else { + bareMetalMachineKeySetParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + if (bareMetalMachineKeySetParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetParameters is required and cannot be null.")); + } else { + bareMetalMachineKeySetParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetParameters, + accept, + context); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineKeySetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineKeySetInner.class, + BareMetalMachineKeySetInner.class, + this.client.getContext()); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineKeySetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineKeySetInner.class, + BareMetalMachineKeySetInner.class, + context); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineKeySetInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters) + .getSyncPoller(); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineKeySetInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineKeySetInner createOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters) { + return createOrUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters) + .block(); + } + + /** + * Create or update the bare metal machine key set of the cluster. + * + *

Create a new bare metal machine key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineKeySetInner createOrUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetInner bareMetalMachineKeySetParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetParameters, context) + .block(); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + accept, + context); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName).getSyncPoller(); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context) + .getSyncPoller(); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName) { + return beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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, String bareMetalMachineKeySetName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + deleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName).block(); + } + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 delete( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { + deleteAsync(resourceGroupName, clusterName, bareMetalMachineKeySetName, context).block(); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters) { + 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + if (bareMetalMachineKeySetUpdateParameters != null) { + bareMetalMachineKeySetUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + 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 (bareMetalMachineKeySetName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineKeySetName is required and cannot be null.")); + } + if (bareMetalMachineKeySetUpdateParameters != null) { + bareMetalMachineKeySetUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetUpdateParameters, + accept, + context); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineKeySetInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineKeySetInner.class, + BareMetalMachineKeySetInner.class, + this.client.getContext()); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineKeySetInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + final BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineKeySetInner.class, + BareMetalMachineKeySetInner.class, + this.client.getContext()); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineKeySetInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetUpdateParameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineKeySetInner.class, + BareMetalMachineKeySetInner.class, + context); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineKeySetInner> beginUpdate( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + final BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters = null; + return this + .beginUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineKeySetInner> beginUpdate( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetUpdateParameters, + context) + .getSyncPoller(); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + final BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters = null; + return beginUpdateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetUpdateParameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineKeySetInner update( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + final BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters = null; + return updateAsync( + resourceGroupName, clusterName, bareMetalMachineKeySetName, bareMetalMachineKeySetUpdateParameters) + .block(); + } + + /** + * Patch bare metal machine key set of the cluster. + * + *

Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with + * it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @param bareMetalMachineKeySetUpdateParameters The request body. + * @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 bareMetalMachineKeySet represents the bare metal machine key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineKeySetInner update( + String resourceGroupName, + String clusterName, + String bareMetalMachineKeySetName, + BareMetalMachineKeySetPatchParameters bareMetalMachineKeySetUpdateParameters, + Context context) { + return updateAsync( + resourceGroupName, + clusterName, + bareMetalMachineKeySetName, + bareMetalMachineKeySetUpdateParameters, + context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bareMetalMachineKeySetList represents a list of bare metal machine key sets along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bareMetalMachineKeySetList represents a list of bare metal machine key sets along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java new file mode 100644 index 000000000000..a8e4a309d3a9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachineKeySetsImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.BareMetalMachineKeySetsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySet; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySets; + +public final class BareMetalMachineKeySetsImpl implements BareMetalMachineKeySets { + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineKeySetsImpl.class); + + private final BareMetalMachineKeySetsClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public BareMetalMachineKeySetsImpl( + BareMetalMachineKeySetsClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new BareMetalMachineKeySetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new BareMetalMachineKeySetImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BareMetalMachineKeySetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BareMetalMachineKeySet get(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + BareMetalMachineKeySetInner inner = + this.serviceClient().get(resourceGroupName, clusterName, bareMetalMachineKeySetName); + if (inner != null) { + return new BareMetalMachineKeySetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName) { + this.serviceClient().delete(resourceGroupName, clusterName, bareMetalMachineKeySetName); + } + + public void delete( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + } + + public BareMetalMachineKeySet getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + if (bareMetalMachineKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", + id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + if (bareMetalMachineKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + if (bareMetalMachineKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", + id))); + } + this.delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bareMetalMachineKeySetName = Utils.getValueFromIdByName(id, "bareMetalMachineKeySets"); + if (bareMetalMachineKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachineKeySets'.", + id))); + } + this.delete(resourceGroupName, clusterName, bareMetalMachineKeySetName, context); + } + + private BareMetalMachineKeySetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public BareMetalMachineKeySetImpl define(String name) { + return new BareMetalMachineKeySetImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java new file mode 100644 index 000000000000..5d5d22397080 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesClientImpl.java @@ -0,0 +1,5352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.BareMetalMachinesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineList; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePatchParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineValidateHardwareParameters; +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 BareMetalMachinesClient. */ +public final class BareMetalMachinesClientImpl implements BareMetalMachinesClient { + /** The proxy service used to perform REST calls. */ + private final BareMetalMachinesService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of BareMetalMachinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BareMetalMachinesClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(BareMetalMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudBareMetalMachines to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudBareMeta") + public interface BareMetalMachinesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/bareMetalMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") BareMetalMachineInner bareMetalMachineParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cordon( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> replace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runCommand( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runDataExtracts( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runReadCommands( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> uncordon( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/validateHardware") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateHardware( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bareMetalMachineName") String bareMetalMachineName, + @BodyParam("application/json") + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 list of bare metal machines in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 list of bare metal machines in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 list of bare metal machines in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 list of bare metal machines in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 list of bare metal machines in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 list of bare metal machines in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of bare metal machines in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of bare metal machines in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of bare metal machines in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of bare metal machines in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of bare metal machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of bare metal machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String bareMetalMachineName) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context); + } + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String bareMetalMachineName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, bareMetalMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String bareMetalMachineName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, bareMetalMachineName, context).block(); + } + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineInner getByResourceGroup(String resourceGroupName, String bareMetalMachineName) { + return getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, Context.NONE).getValue(); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineParameters is required and cannot be null.")); + } else { + bareMetalMachineParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineParameters is required and cannot be null.")); + } else { + bareMetalMachineParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineParameters, + accept, + context); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineInner.class, + BareMetalMachineInner.class, + this.client.getContext()); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BareMetalMachineInner.class, BareMetalMachineInner.class, context); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineInner> beginCreateOrUpdate( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters) + .getSyncPoller(); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineInner> beginCreateOrUpdate( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineInner createOrUpdate( + String resourceGroupName, String bareMetalMachineName, BareMetalMachineInner bareMetalMachineParameters) { + return createOrUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters).block(); + } + + /** + * Create or update the bare metal machine. + * + *

Create a new bare metal machine or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineInner createOrUpdate( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineInner bareMetalMachineParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineParameters, context) + .block(); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String bareMetalMachineName) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, bareMetalMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, bareMetalMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName) { + return this.beginDeleteAsync(resourceGroupName, bareMetalMachineName).getSyncPoller(); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName, Context context) { + return this.beginDeleteAsync(resourceGroupName, bareMetalMachineName, context).getSyncPoller(); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName) { + return beginDeleteAsync(resourceGroupName, bareMetalMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachineName, Context context) { + return beginDeleteAsync(resourceGroupName, bareMetalMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 delete(String resourceGroupName, String bareMetalMachineName) { + deleteAsync(resourceGroupName, bareMetalMachineName).block(); + } + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 delete(String resourceGroupName, String bareMetalMachineName, Context context) { + deleteAsync(resourceGroupName, bareMetalMachineName, context).block(); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineUpdateParameters != null) { + bareMetalMachineUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineUpdateParameters != null) { + bareMetalMachineUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineUpdateParameters, + accept, + context); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineInner> beginUpdateAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineInner.class, + BareMetalMachineInner.class, + this.client.getContext()); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineInner> beginUpdateAsync( + String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePatchParameters bareMetalMachineUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BareMetalMachineInner.class, + BareMetalMachineInner.class, + this.client.getContext()); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BareMetalMachineInner> beginUpdateAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BareMetalMachineInner.class, BareMetalMachineInner.class, context); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineInner> beginUpdate( + String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePatchParameters bareMetalMachineUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BareMetalMachineInner> beginUpdate( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters) { + return beginUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachine represents the physical machine in the rack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePatchParameters bareMetalMachineUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineInner update(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePatchParameters bareMetalMachineUpdateParameters = null; + return updateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters).block(); + } + + /** + * Patch the bare metal machine. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineUpdateParameters The request body. + * @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 bareMetalMachine represents the physical machine in the rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BareMetalMachineInner update( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePatchParameters bareMetalMachineUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineUpdateParameters, context).block(); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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>> cordonWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineCordonParameters != null) { + bareMetalMachineCordonParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cordon( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineCordonParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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>> cordonWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineCordonParameters != null) { + bareMetalMachineCordonParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cordon( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineCordonParameters, + accept, + context); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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> beginCordonAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters) { + Mono>> mono = + cordonWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginCordonAsync(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineCordonParameters bareMetalMachineCordonParameters = null; + Mono>> mono = + cordonWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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> beginCordonAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cordonWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginCordon(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineCordonParameters bareMetalMachineCordonParameters = null; + return this + .beginCordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters) + .getSyncPoller(); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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> beginCordon( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context) { + return this + .beginCordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters, context) + .getSyncPoller(); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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 cordonAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters) { + return beginCordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 cordonAsync(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineCordonParameters bareMetalMachineCordonParameters = null; + return beginCordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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 cordonAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context) { + return beginCordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 cordon(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineCordonParameters bareMetalMachineCordonParameters = null; + cordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters).block(); + } + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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 cordon( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context) { + cordonAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters, context).block(); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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>> powerOffWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachinePowerOffParameters != null) { + bareMetalMachinePowerOffParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachinePowerOffParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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>> powerOffWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachinePowerOffParameters != null) { + bareMetalMachinePowerOffParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachinePowerOffParameters, + accept, + context); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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> beginPowerOffAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginPowerOffAsync( + String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters = null; + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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> beginPowerOffAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + powerOffWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginPowerOff(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters = null; + return this + .beginPowerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters) + .getSyncPoller(); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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> beginPowerOff( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context) { + return this + .beginPowerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters, context) + .getSyncPoller(); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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 powerOffAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters) { + return beginPowerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 powerOffAsync(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters = null; + return beginPowerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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 powerOffAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context) { + return beginPowerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 powerOff(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters = null; + powerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters).block(); + } + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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 powerOff( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context) { + powerOffAsync(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters, context).block(); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> reimageWithResponseAsync( + String resourceGroupName, String bareMetalMachineName) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> reimageWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReimageAsync( + String resourceGroupName, String bareMetalMachineName) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, bareMetalMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReimageAsync( + String resourceGroupName, String bareMetalMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, bareMetalMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReimage(String resourceGroupName, String bareMetalMachineName) { + return this.beginReimageAsync(resourceGroupName, bareMetalMachineName).getSyncPoller(); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReimage( + String resourceGroupName, String bareMetalMachineName, Context context) { + return this.beginReimageAsync(resourceGroupName, bareMetalMachineName, context).getSyncPoller(); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimageAsync(String resourceGroupName, String bareMetalMachineName) { + return beginReimageAsync(resourceGroupName, bareMetalMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimageAsync(String resourceGroupName, String bareMetalMachineName, Context context) { + return beginReimageAsync(resourceGroupName, bareMetalMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimage(String resourceGroupName, String bareMetalMachineName) { + reimageAsync(resourceGroupName, bareMetalMachineName).block(); + } + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimage(String resourceGroupName, String bareMetalMachineName, Context context) { + reimageAsync(resourceGroupName, bareMetalMachineName, context).block(); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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>> replaceWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineReplaceParameters != null) { + bareMetalMachineReplaceParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .replace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineReplaceParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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>> replaceWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineReplaceParameters != null) { + bareMetalMachineReplaceParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .replace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineReplaceParameters, + accept, + context); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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> beginReplaceAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters) { + Mono>> mono = + replaceWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReplaceAsync( + String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters = null; + Mono>> mono = + replaceWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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> beginReplaceAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + replaceWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginReplace(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters = null; + return this + .beginReplaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters) + .getSyncPoller(); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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> beginReplace( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context) { + return this + .beginReplaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters, context) + .getSyncPoller(); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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 replaceAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters) { + return beginReplaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 replaceAsync(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters = null; + return beginReplaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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 replaceAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context) { + return beginReplaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 replace(String resourceGroupName, String bareMetalMachineName) { + final BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters = null; + replaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters).block(); + } + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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 replace( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context) { + replaceAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters, context).block(); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> restartWithResponseAsync( + String resourceGroupName, String bareMetalMachineName) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> restartWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginRestartAsync( + String resourceGroupName, String bareMetalMachineName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, bareMetalMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginRestartAsync( + String resourceGroupName, String bareMetalMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, bareMetalMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginRestart(String resourceGroupName, String bareMetalMachineName) { + return this.beginRestartAsync(resourceGroupName, bareMetalMachineName).getSyncPoller(); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginRestart( + String resourceGroupName, String bareMetalMachineName, Context context) { + return this.beginRestartAsync(resourceGroupName, bareMetalMachineName, context).getSyncPoller(); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restartAsync(String resourceGroupName, String bareMetalMachineName) { + return beginRestartAsync(resourceGroupName, bareMetalMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restartAsync(String resourceGroupName, String bareMetalMachineName, Context context) { + return beginRestartAsync(resourceGroupName, bareMetalMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restart(String resourceGroupName, String bareMetalMachineName) { + restartAsync(resourceGroupName, bareMetalMachineName).block(); + } + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restart(String resourceGroupName, String bareMetalMachineName, Context context) { + restartAsync(resourceGroupName, bareMetalMachineName, context).block(); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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>> runCommandWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineRunCommandParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineRunCommandParameters is required and cannot be null.")); + } else { + bareMetalMachineRunCommandParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .runCommand( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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>> runCommandWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineRunCommandParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineRunCommandParameters is required and cannot be null.")); + } else { + bareMetalMachineRunCommandParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .runCommand( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunCommandParameters, + accept, + context); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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> beginRunCommandAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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> beginRunCommandAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runCommandWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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> beginRunCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + return this + .beginRunCommandAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters) + .getSyncPoller(); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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> beginRunCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context) { + return this + .beginRunCommandAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, context) + .getSyncPoller(); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommandAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + return beginRunCommandAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommandAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context) { + return beginRunCommandAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + runCommandAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters).block(); + } + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context) { + runCommandAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, context).block(); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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>> runDataExtractsWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineRunDataExtractsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineRunDataExtractsParameters is required and cannot be null.")); + } else { + bareMetalMachineRunDataExtractsParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .runDataExtracts( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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>> runDataExtractsWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineRunDataExtractsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineRunDataExtractsParameters is required and cannot be null.")); + } else { + bareMetalMachineRunDataExtractsParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .runDataExtracts( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunDataExtractsParameters, + accept, + context); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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> beginRunDataExtractsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + Mono>> mono = + runDataExtractsWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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> beginRunDataExtractsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runDataExtractsWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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> beginRunDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + return this + .beginRunDataExtractsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters) + .getSyncPoller(); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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> beginRunDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context) { + return this + .beginRunDataExtractsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, context) + .getSyncPoller(); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtractsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + return beginRunDataExtractsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtractsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context) { + return beginRunDataExtractsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + runDataExtractsAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters) + .block(); + } + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context) { + runDataExtractsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, context) + .block(); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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>> runReadCommandsWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineRunReadCommandsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineRunReadCommandsParameters is required and cannot be null.")); + } else { + bareMetalMachineRunReadCommandsParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .runReadCommands( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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>> runReadCommandsWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineRunReadCommandsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineRunReadCommandsParameters is required and cannot be null.")); + } else { + bareMetalMachineRunReadCommandsParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .runReadCommands( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineRunReadCommandsParameters, + accept, + context); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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> beginRunReadCommandsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + Mono>> mono = + runReadCommandsWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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> beginRunReadCommandsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runReadCommandsWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + return this + .beginRunReadCommandsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters) + .getSyncPoller(); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context) { + return this + .beginRunReadCommandsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, context) + .getSyncPoller(); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommandsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + return beginRunReadCommandsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommandsAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context) { + return beginRunReadCommandsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + runReadCommandsAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters) + .block(); + } + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context) { + runReadCommandsAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, context) + .block(); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> startWithResponseAsync( + String resourceGroupName, String bareMetalMachineName) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> startWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginStartAsync(String resourceGroupName, String bareMetalMachineName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, bareMetalMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginStartAsync( + String resourceGroupName, String bareMetalMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, bareMetalMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginStart(String resourceGroupName, String bareMetalMachineName) { + return this.beginStartAsync(resourceGroupName, bareMetalMachineName).getSyncPoller(); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginStart( + String resourceGroupName, String bareMetalMachineName, Context context) { + return this.beginStartAsync(resourceGroupName, bareMetalMachineName, context).getSyncPoller(); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 startAsync(String resourceGroupName, String bareMetalMachineName) { + return beginStartAsync(resourceGroupName, bareMetalMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 startAsync(String resourceGroupName, String bareMetalMachineName, Context context) { + return beginStartAsync(resourceGroupName, bareMetalMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 start(String resourceGroupName, String bareMetalMachineName) { + startAsync(resourceGroupName, bareMetalMachineName).block(); + } + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 start(String resourceGroupName, String bareMetalMachineName, Context context) { + startAsync(resourceGroupName, bareMetalMachineName, context).block(); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> uncordonWithResponseAsync( + String resourceGroupName, String bareMetalMachineName) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .uncordon( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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>> uncordonWithResponseAsync( + String resourceGroupName, String bareMetalMachineName, 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .uncordon( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + accept, + context); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginUncordonAsync( + String resourceGroupName, String bareMetalMachineName) { + Mono>> mono = uncordonWithResponseAsync(resourceGroupName, bareMetalMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginUncordonAsync( + String resourceGroupName, String bareMetalMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + uncordonWithResponseAsync(resourceGroupName, bareMetalMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginUncordon(String resourceGroupName, String bareMetalMachineName) { + return this.beginUncordonAsync(resourceGroupName, bareMetalMachineName).getSyncPoller(); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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> beginUncordon( + String resourceGroupName, String bareMetalMachineName, Context context) { + return this.beginUncordonAsync(resourceGroupName, bareMetalMachineName, context).getSyncPoller(); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordonAsync(String resourceGroupName, String bareMetalMachineName) { + return beginUncordonAsync(resourceGroupName, bareMetalMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordonAsync(String resourceGroupName, String bareMetalMachineName, Context context) { + return beginUncordonAsync(resourceGroupName, bareMetalMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordon(String resourceGroupName, String bareMetalMachineName) { + uncordonAsync(resourceGroupName, bareMetalMachineName).block(); + } + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordon(String resourceGroupName, String bareMetalMachineName, Context context) { + uncordonAsync(resourceGroupName, bareMetalMachineName, context).block(); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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>> validateHardwareWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineValidateHardwareParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineValidateHardwareParameters is required and cannot be null.")); + } else { + bareMetalMachineValidateHardwareParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateHardware( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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>> validateHardwareWithResponseAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + 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 (bareMetalMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bareMetalMachineName is required and cannot be null.")); + } + if (bareMetalMachineValidateHardwareParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter bareMetalMachineValidateHardwareParameters is required and cannot be null.")); + } else { + bareMetalMachineValidateHardwareParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateHardware( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + bareMetalMachineName, + bareMetalMachineValidateHardwareParameters, + accept, + context); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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> beginValidateHardwareAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + Mono>> mono = + validateHardwareWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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> beginValidateHardwareAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateHardwareWithResponseAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + return this + .beginValidateHardwareAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters) + .getSyncPoller(); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context) { + return this + .beginValidateHardwareAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, context) + .getSyncPoller(); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardwareAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + return beginValidateHardwareAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardwareAsync( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context) { + return beginValidateHardwareAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + validateHardwareAsync(resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters) + .block(); + } + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context) { + validateHardwareAsync( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bareMetalMachineList represents a list of bare metal machines along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java new file mode 100644 index 000000000000..eaddfe4e926c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BareMetalMachinesImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.BareMetalMachinesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachine; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineValidateHardwareParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachines; + +public final class BareMetalMachinesImpl implements BareMetalMachines { + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachinesImpl.class); + + private final BareMetalMachinesClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public BareMetalMachinesImpl( + BareMetalMachinesClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new BareMetalMachineImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String bareMetalMachineName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BareMetalMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BareMetalMachine getByResourceGroup(String resourceGroupName, String bareMetalMachineName) { + BareMetalMachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, bareMetalMachineName); + if (inner != null) { + return new BareMetalMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().delete(resourceGroupName, bareMetalMachineName); + } + + public void delete(String resourceGroupName, String bareMetalMachineName, Context context) { + this.serviceClient().delete(resourceGroupName, bareMetalMachineName, context); + } + + public void cordon(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().cordon(resourceGroupName, bareMetalMachineName); + } + + public void cordon( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context) { + this.serviceClient().cordon(resourceGroupName, bareMetalMachineName, bareMetalMachineCordonParameters, context); + } + + public void powerOff(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().powerOff(resourceGroupName, bareMetalMachineName); + } + + public void powerOff( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context) { + this + .serviceClient() + .powerOff(resourceGroupName, bareMetalMachineName, bareMetalMachinePowerOffParameters, context); + } + + public void reimage(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().reimage(resourceGroupName, bareMetalMachineName); + } + + public void reimage(String resourceGroupName, String bareMetalMachineName, Context context) { + this.serviceClient().reimage(resourceGroupName, bareMetalMachineName, context); + } + + public void replace(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().replace(resourceGroupName, bareMetalMachineName); + } + + public void replace( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context) { + this + .serviceClient() + .replace(resourceGroupName, bareMetalMachineName, bareMetalMachineReplaceParameters, context); + } + + public void restart(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().restart(resourceGroupName, bareMetalMachineName); + } + + public void restart(String resourceGroupName, String bareMetalMachineName, Context context) { + this.serviceClient().restart(resourceGroupName, bareMetalMachineName, context); + } + + public void runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters) { + this.serviceClient().runCommand(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters); + } + + public void runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context) { + this + .serviceClient() + .runCommand(resourceGroupName, bareMetalMachineName, bareMetalMachineRunCommandParameters, context); + } + + public void runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters) { + this + .serviceClient() + .runDataExtracts(resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters); + } + + public void runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context) { + this + .serviceClient() + .runDataExtracts( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunDataExtractsParameters, context); + } + + public void runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters) { + this + .serviceClient() + .runReadCommands(resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters); + } + + public void runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context) { + this + .serviceClient() + .runReadCommands( + resourceGroupName, bareMetalMachineName, bareMetalMachineRunReadCommandsParameters, context); + } + + public void start(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().start(resourceGroupName, bareMetalMachineName); + } + + public void start(String resourceGroupName, String bareMetalMachineName, Context context) { + this.serviceClient().start(resourceGroupName, bareMetalMachineName, context); + } + + public void uncordon(String resourceGroupName, String bareMetalMachineName) { + this.serviceClient().uncordon(resourceGroupName, bareMetalMachineName); + } + + public void uncordon(String resourceGroupName, String bareMetalMachineName, Context context) { + this.serviceClient().uncordon(resourceGroupName, bareMetalMachineName, context); + } + + public void validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters) { + this + .serviceClient() + .validateHardware(resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters); + } + + public void validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context) { + this + .serviceClient() + .validateHardware( + resourceGroupName, bareMetalMachineName, bareMetalMachineValidateHardwareParameters, context); + } + + public BareMetalMachine getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + if (bareMetalMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + if (bareMetalMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, bareMetalMachineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + if (bareMetalMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); + } + this.delete(resourceGroupName, bareMetalMachineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bareMetalMachineName = Utils.getValueFromIdByName(id, "bareMetalMachines"); + if (bareMetalMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalMachines'.", id))); + } + this.delete(resourceGroupName, bareMetalMachineName, context); + } + + private BareMetalMachinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public BareMetalMachineImpl define(String name) { + return new BareMetalMachineImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java new file mode 100644 index 000000000000..59afaebf1a65 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BmcKeySet; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPatchParameters; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.KeySetUserStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BmcKeySetImpl implements BmcKeySet, BmcKeySet.Definition, BmcKeySet.Update { + private BmcKeySetInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String azureGroupId() { + return this.innerModel().azureGroupId(); + } + + public BmcKeySetDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public OffsetDateTime expiration() { + return this.innerModel().expiration(); + } + + public OffsetDateTime lastValidation() { + return this.innerModel().lastValidation(); + } + + public BmcKeySetPrivilegeLevel privilegeLevel() { + return this.innerModel().privilegeLevel(); + } + + public BmcKeySetProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List userList() { + List inner = this.innerModel().userList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List userListStatus() { + List inner = this.innerModel().userListStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BmcKeySetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String bmcKeySetName; + + private BmcKeySetPatchParameters updateBmcKeySetUpdateParameters; + + public BmcKeySetImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public BmcKeySet create() { + this.innerObject = + serviceManager + .serviceClient() + .getBmcKeySets() + .createOrUpdate(resourceGroupName, clusterName, bmcKeySetName, this.innerModel(), Context.NONE); + return this; + } + + public BmcKeySet create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBmcKeySets() + .createOrUpdate(resourceGroupName, clusterName, bmcKeySetName, this.innerModel(), context); + return this; + } + + BmcKeySetImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new BmcKeySetInner(); + this.serviceManager = serviceManager; + this.bmcKeySetName = name; + } + + public BmcKeySetImpl update() { + this.updateBmcKeySetUpdateParameters = new BmcKeySetPatchParameters(); + return this; + } + + public BmcKeySet apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBmcKeySets() + .update(resourceGroupName, clusterName, bmcKeySetName, updateBmcKeySetUpdateParameters, Context.NONE); + return this; + } + + public BmcKeySet apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBmcKeySets() + .update(resourceGroupName, clusterName, bmcKeySetName, updateBmcKeySetUpdateParameters, context); + return this; + } + + BmcKeySetImpl( + BmcKeySetInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.bmcKeySetName = Utils.getValueFromIdByName(innerObject.id(), "bmcKeySets"); + } + + public BmcKeySet refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBmcKeySets() + .getWithResponse(resourceGroupName, clusterName, bmcKeySetName, Context.NONE) + .getValue(); + return this; + } + + public BmcKeySet refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBmcKeySets() + .getWithResponse(resourceGroupName, clusterName, bmcKeySetName, context) + .getValue(); + return this; + } + + public BmcKeySetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BmcKeySetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BmcKeySetImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public BmcKeySetImpl withAzureGroupId(String azureGroupId) { + this.innerModel().withAzureGroupId(azureGroupId); + return this; + } + + public BmcKeySetImpl withExpiration(OffsetDateTime expiration) { + if (isInCreateMode()) { + this.innerModel().withExpiration(expiration); + return this; + } else { + this.updateBmcKeySetUpdateParameters.withExpiration(expiration); + return this; + } + } + + public BmcKeySetImpl withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeLevel) { + this.innerModel().withPrivilegeLevel(privilegeLevel); + return this; + } + + public BmcKeySetImpl withUserList(List userList) { + if (isInCreateMode()) { + this.innerModel().withUserList(userList); + return this; + } else { + this.updateBmcKeySetUpdateParameters.withUserList(userList); + return this; + } + } + + public BmcKeySetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBmcKeySetUpdateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java new file mode 100644 index 000000000000..395fffaf7f4f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsClientImpl.java @@ -0,0 +1,1605 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.BmcKeySetsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetList; +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPatchParameters; +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 BmcKeySetsClient. */ +public final class BmcKeySetsClientImpl implements BmcKeySetsClient { + /** The proxy service used to perform REST calls. */ + private final BmcKeySetsService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of BmcKeySetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BmcKeySetsClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(BmcKeySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudBmcKeySets to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudBmcKeySe") + public interface BmcKeySetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bmcKeySetName") String bmcKeySetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bmcKeySetName") String bmcKeySetName, + @BodyParam("application/json") BmcKeySetInner bmcKeySetParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bmcKeySetName") String bmcKeySetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("bmcKeySetName") String bmcKeySetName, + @BodyParam("application/json") BmcKeySetPatchParameters bmcKeySetUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 list of baseboard management controller key sets of the cluster in the provided resource group along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, clusterName)); + } + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, clusterName, context)); + } + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String bmcKeySetName) { + 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String bmcKeySetName, 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + accept, + context); + } + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String bmcKeySetName) { + return getWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, context).block(); + } + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BmcKeySetInner get(String resourceGroupName, String clusterName, String bmcKeySetName) { + return getWithResponse(resourceGroupName, clusterName, bmcKeySetName, Context.NONE).getValue(); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters) { + 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + if (bmcKeySetParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter bmcKeySetParameters is required and cannot be null.")); + } else { + bmcKeySetParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + if (bmcKeySetParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter bmcKeySetParameters is required and cannot be null.")); + } else { + bmcKeySetParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetParameters, + accept, + context); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BmcKeySetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BmcKeySetInner.class, + BmcKeySetInner.class, + this.client.getContext()); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BmcKeySetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BmcKeySetInner.class, BmcKeySetInner.class, context); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BmcKeySetInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters) + .getSyncPoller(); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BmcKeySetInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BmcKeySetInner createOrUpdate( + String resourceGroupName, String clusterName, String bmcKeySetName, BmcKeySetInner bmcKeySetParameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters).block(); + } + + /** + * Create or update the baseboard management controller key set of the cluster. + * + *

Create a new baseboard management controller key set or update the existing one for the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BmcKeySetInner createOrUpdate( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetInner bmcKeySetParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetParameters, context).block(); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String bmcKeySetName) { + 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String bmcKeySetName, 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + accept, + context); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName).getSyncPoller(); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName, context).getSyncPoller(); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName) { + return beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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, String bmcKeySetName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, bmcKeySetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 delete(String resourceGroupName, String clusterName, String bmcKeySetName) { + deleteAsync(resourceGroupName, clusterName, bmcKeySetName).block(); + } + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { + deleteAsync(resourceGroupName, clusterName, bmcKeySetName, context).block(); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters) { + 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + if (bmcKeySetUpdateParameters != null) { + bmcKeySetUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + 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 (bmcKeySetName == null) { + return Mono.error(new IllegalArgumentException("Parameter bmcKeySetName is required and cannot be null.")); + } + if (bmcKeySetUpdateParameters != null) { + bmcKeySetUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + bmcKeySetName, + bmcKeySetUpdateParameters, + accept, + context); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BmcKeySetInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BmcKeySetInner.class, + BmcKeySetInner.class, + this.client.getContext()); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BmcKeySetInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String bmcKeySetName) { + final BmcKeySetPatchParameters bmcKeySetUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BmcKeySetInner.class, + BmcKeySetInner.class, + this.client.getContext()); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BmcKeySetInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BmcKeySetInner.class, BmcKeySetInner.class, context); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BmcKeySetInner> beginUpdate( + String resourceGroupName, String clusterName, String bmcKeySetName) { + final BmcKeySetPatchParameters bmcKeySetUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BmcKeySetInner> beginUpdate( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters) { + return beginUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 bmcKeySet represents the baseboard management controller key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, String bmcKeySetName) { + final BmcKeySetPatchParameters bmcKeySetUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BmcKeySetInner update(String resourceGroupName, String clusterName, String bmcKeySetName) { + final BmcKeySetPatchParameters bmcKeySetUpdateParameters = null; + return updateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters).block(); + } + + /** + * Patch baseboard management controller key set of the cluster. + * + *

Patch properties of baseboard management controller key set for the provided cluster, or update the tags + * associated with it. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @param bmcKeySetUpdateParameters The request body. + * @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 bmcKeySet represents the baseboard management controller key set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BmcKeySetInner update( + String resourceGroupName, + String clusterName, + String bmcKeySetName, + BmcKeySetPatchParameters bmcKeySetUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, clusterName, bmcKeySetName, bmcKeySetUpdateParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bmcKeySetList represents a list of baseboard management controller key sets along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 bmcKeySetList represents a list of baseboard management controller key sets along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java new file mode 100644 index 000000000000..965d4a70bd1f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/BmcKeySetsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.BmcKeySetsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.azure.resourcemanager.networkcloud.models.BmcKeySet; +import com.azure.resourcemanager.networkcloud.models.BmcKeySets; + +public final class BmcKeySetsImpl implements BmcKeySets { + private static final ClientLogger LOGGER = new ClientLogger(BmcKeySetsImpl.class); + + private final BmcKeySetsClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public BmcKeySetsImpl( + BmcKeySetsClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new BmcKeySetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new BmcKeySetImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, bmcKeySetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BmcKeySetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BmcKeySet get(String resourceGroupName, String clusterName, String bmcKeySetName) { + BmcKeySetInner inner = this.serviceClient().get(resourceGroupName, clusterName, bmcKeySetName); + if (inner != null) { + return new BmcKeySetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String bmcKeySetName) { + this.serviceClient().delete(resourceGroupName, clusterName, bmcKeySetName); + } + + public void delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, bmcKeySetName, context); + } + + public BmcKeySet getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + if (bmcKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, bmcKeySetName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + if (bmcKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, bmcKeySetName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + if (bmcKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); + } + this.delete(resourceGroupName, clusterName, bmcKeySetName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String bmcKeySetName = Utils.getValueFromIdByName(id, "bmcKeySets"); + if (bmcKeySetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bmcKeySets'.", id))); + } + this.delete(resourceGroupName, clusterName, bmcKeySetName, context); + } + + private BmcKeySetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public BmcKeySetImpl define(String name) { + return new BmcKeySetImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java new file mode 100644 index 000000000000..7542d90e7a13 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworkImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkPatchParameters; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkProvisioningState; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CloudServicesNetworkImpl + implements CloudServicesNetwork, CloudServicesNetwork.Definition, CloudServicesNetwork.Update { + private CloudServicesNetworkInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List additionalEgressEndpoints() { + List inner = this.innerModel().additionalEgressEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public CloudServicesNetworkDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { + return this.innerModel().enableDefaultEgressEndpoints(); + } + + public List enabledEgressEndpoints() { + List inner = this.innerModel().enabledEgressEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List hybridAksClustersAssociatedIds() { + List inner = this.innerModel().hybridAksClustersAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public CloudServicesNetworkProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List virtualMachinesAssociatedIds() { + List inner = this.innerModel().virtualMachinesAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudServicesNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudServicesNetworkName; + + private CloudServicesNetworkPatchParameters updateCloudServicesNetworkUpdateParameters; + + public CloudServicesNetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudServicesNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServicesNetworks() + .createOrUpdate(resourceGroupName, cloudServicesNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public CloudServicesNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServicesNetworks() + .createOrUpdate(resourceGroupName, cloudServicesNetworkName, this.innerModel(), context); + return this; + } + + CloudServicesNetworkImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new CloudServicesNetworkInner(); + this.serviceManager = serviceManager; + this.cloudServicesNetworkName = name; + } + + public CloudServicesNetworkImpl update() { + this.updateCloudServicesNetworkUpdateParameters = new CloudServicesNetworkPatchParameters(); + return this; + } + + public CloudServicesNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServicesNetworks() + .update( + resourceGroupName, + cloudServicesNetworkName, + updateCloudServicesNetworkUpdateParameters, + Context.NONE); + return this; + } + + public CloudServicesNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServicesNetworks() + .update( + resourceGroupName, cloudServicesNetworkName, updateCloudServicesNetworkUpdateParameters, context); + return this; + } + + CloudServicesNetworkImpl( + CloudServicesNetworkInner innerObject, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudServicesNetworkName = Utils.getValueFromIdByName(innerObject.id(), "cloudServicesNetworks"); + } + + public CloudServicesNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServicesNetworks() + .getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, Context.NONE) + .getValue(); + return this; + } + + public CloudServicesNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudServicesNetworks() + .getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, context) + .getValue(); + return this; + } + + public CloudServicesNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudServicesNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudServicesNetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public CloudServicesNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCloudServicesNetworkUpdateParameters.withTags(tags); + return this; + } + } + + public CloudServicesNetworkImpl withAdditionalEgressEndpoints(List additionalEgressEndpoints) { + if (isInCreateMode()) { + this.innerModel().withAdditionalEgressEndpoints(additionalEgressEndpoints); + return this; + } else { + this.updateCloudServicesNetworkUpdateParameters.withAdditionalEgressEndpoints(additionalEgressEndpoints); + return this; + } + } + + public CloudServicesNetworkImpl withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints) { + if (isInCreateMode()) { + this.innerModel().withEnableDefaultEgressEndpoints(enableDefaultEgressEndpoints); + return this; + } else { + this + .updateCloudServicesNetworkUpdateParameters + .withEnableDefaultEgressEndpoints(enableDefaultEgressEndpoints); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java new file mode 100644 index 000000000000..4a448a8c8186 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksClientImpl.java @@ -0,0 +1,1818 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.CloudServicesNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkList; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkPatchParameters; +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 CloudServicesNetworksClient. */ +public final class CloudServicesNetworksClientImpl implements CloudServicesNetworksClient { + /** The proxy service used to perform REST calls. */ + private final CloudServicesNetworksService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of CloudServicesNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudServicesNetworksClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy + .create(CloudServicesNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudCloudServicesNetworks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudCloudSer") + public interface CloudServicesNetworksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServicesNetworkName") String cloudServicesNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServicesNetworkName") String cloudServicesNetworkName, + @BodyParam("application/json") CloudServicesNetworkInner cloudServicesNetworkParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServicesNetworkName") String cloudServicesNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudServicesNetworkName") String cloudServicesNetworkName, + @BodyParam("application/json") CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 list of cloud services networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 list of cloud services networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 list of cloud services networks in the provided subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 list of cloud services networks in the provided subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 list of cloud services networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 list of cloud services networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cloud services networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cloud services networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cloud services networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cloud services networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cloud services networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cloud services networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String cloudServicesNetworkName) { + 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String cloudServicesNetworkName, 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + accept, + context); + } + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String cloudServicesNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudServicesNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServicesNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudServicesNetworkName, context).block(); + } + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServicesNetworkInner getByResourceGroup(String resourceGroupName, String cloudServicesNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, Context.NONE).getValue(); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters) { + 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + if (cloudServicesNetworkParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cloudServicesNetworkParameters is required and cannot be null.")); + } else { + cloudServicesNetworkParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + if (cloudServicesNetworkParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter cloudServicesNetworkParameters is required and cannot be null.")); + } else { + cloudServicesNetworkParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkParameters, + accept, + context); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServicesNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServicesNetworkInner.class, + CloudServicesNetworkInner.class, + this.client.getContext()); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServicesNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServicesNetworkInner.class, + CloudServicesNetworkInner.class, + context); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters) + .getSyncPoller(); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServicesNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServicesNetworkInner createOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters) { + return createOrUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters).block(); + } + + /** + * Create or update the cloud services network. + * + *

Create a new cloud services network or update the properties of the existing cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServicesNetworkInner createOrUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkInner cloudServicesNetworkParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkParameters, context) + .block(); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String cloudServicesNetworkName) { + 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String cloudServicesNetworkName, 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + accept, + context); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudServicesNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, cloudServicesNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName) { + return this.beginDeleteAsync(resourceGroupName, cloudServicesNetworkName).getSyncPoller(); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName, Context context) { + return this.beginDeleteAsync(resourceGroupName, cloudServicesNetworkName, context).getSyncPoller(); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName) { + return beginDeleteAsync(resourceGroupName, cloudServicesNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, cloudServicesNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 delete(String resourceGroupName, String cloudServicesNetworkName) { + deleteAsync(resourceGroupName, cloudServicesNetworkName).block(); + } + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 delete(String resourceGroupName, String cloudServicesNetworkName, Context context) { + deleteAsync(resourceGroupName, cloudServicesNetworkName, context).block(); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters) { + 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + if (cloudServicesNetworkUpdateParameters != null) { + cloudServicesNetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + 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 (cloudServicesNetworkName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter cloudServicesNetworkName is required and cannot be null.")); + } + if (cloudServicesNetworkUpdateParameters != null) { + cloudServicesNetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + cloudServicesNetworkName, + cloudServicesNetworkUpdateParameters, + accept, + context); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServicesNetworkInner> beginUpdateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServicesNetworkInner.class, + CloudServicesNetworkInner.class, + this.client.getContext()); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServicesNetworkInner> beginUpdateAsync( + String resourceGroupName, String cloudServicesNetworkName) { + final CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServicesNetworkInner.class, + CloudServicesNetworkInner.class, + this.client.getContext()); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudServicesNetworkInner> beginUpdateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CloudServicesNetworkInner.class, + CloudServicesNetworkInner.class, + context); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServicesNetworkInner> beginUpdate( + String resourceGroupName, String cloudServicesNetworkName) { + final CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that + * will be used by associated virtual machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudServicesNetworkInner> beginUpdate( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters) { + return beginUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String cloudServicesNetworkName) { + final CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServicesNetworkInner update(String resourceGroupName, String cloudServicesNetworkName) { + final CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters = null; + return updateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters).block(); + } + + /** + * Patch the cloud services network. + * + *

Update properties of the provided cloud services network, or update the tags associated with it. Properties + * and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @param cloudServicesNetworkUpdateParameters The request body. + * @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 cloudServicesNetwork represents additional egress information that will be used by associated virtual + * machines or hybrid AKS clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudServicesNetworkInner update( + String resourceGroupName, + String cloudServicesNetworkName, + CloudServicesNetworkPatchParameters cloudServicesNetworkUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, cloudServicesNetworkName, cloudServicesNetworkUpdateParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 cloudServicesNetworkList represents a list of cloud services networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java new file mode 100644 index 000000000000..fc5ef6e2cb05 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/CloudServicesNetworksImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.CloudServicesNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworks; + +public final class CloudServicesNetworksImpl implements CloudServicesNetworks { + private static final ClientLogger LOGGER = new ClientLogger(CloudServicesNetworksImpl.class); + + private final CloudServicesNetworksClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public CloudServicesNetworksImpl( + CloudServicesNetworksClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new CloudServicesNetworkImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServicesNetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudServicesNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudServicesNetwork getByResourceGroup(String resourceGroupName, String cloudServicesNetworkName) { + CloudServicesNetworkInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, cloudServicesNetworkName); + if (inner != null) { + return new CloudServicesNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String cloudServicesNetworkName) { + this.serviceClient().delete(resourceGroupName, cloudServicesNetworkName); + } + + public void delete(String resourceGroupName, String cloudServicesNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, cloudServicesNetworkName, context); + } + + public CloudServicesNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + if (cloudServicesNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + if (cloudServicesNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudServicesNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + if (cloudServicesNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", + id))); + } + this.delete(resourceGroupName, cloudServicesNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String cloudServicesNetworkName = Utils.getValueFromIdByName(id, "cloudServicesNetworks"); + if (cloudServicesNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'cloudServicesNetworks'.", + id))); + } + this.delete(resourceGroupName, cloudServicesNetworkName, context); + } + + private CloudServicesNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public CloudServicesNetworkImpl define(String name) { + return new CloudServicesNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java new file mode 100644 index 000000000000..5b369aeaa819 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterImpl.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; +import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.ClusterAvailableUpgradeVersion; +import com.azure.resourcemanager.networkcloud.models.ClusterCapacity; +import com.azure.resourcemanager.networkcloud.models.ClusterConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerConnectionStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RackDefinition aggregatorOrSingleRackDefinition() { + return this.innerModel().aggregatorOrSingleRackDefinition(); + } + + public String analyticsWorkspaceId() { + return this.innerModel().analyticsWorkspaceId(); + } + + public List availableUpgradeVersions() { + List inner = this.innerModel().availableUpgradeVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterCapacity clusterCapacity() { + return this.innerModel().clusterCapacity(); + } + + public ClusterConnectionStatus clusterConnectionStatus() { + return this.innerModel().clusterConnectionStatus(); + } + + public ExtendedLocation clusterExtendedLocation() { + return this.innerModel().clusterExtendedLocation(); + } + + public String clusterLocation() { + return this.innerModel().clusterLocation(); + } + + public ClusterManagerConnectionStatus clusterManagerConnectionStatus() { + return this.innerModel().clusterManagerConnectionStatus(); + } + + public String clusterManagerId() { + return this.innerModel().clusterManagerId(); + } + + public ServicePrincipalInformation clusterServicePrincipal() { + return this.innerModel().clusterServicePrincipal(); + } + + public ClusterType clusterType() { + return this.innerModel().clusterType(); + } + + public String clusterVersion() { + return this.innerModel().clusterVersion(); + } + + public ValidationThreshold computeDeploymentThreshold() { + return this.innerModel().computeDeploymentThreshold(); + } + + public List computeRackDefinitions() { + List inner = this.innerModel().computeRackDefinitions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public ExtendedLocation hybridAksExtendedLocation() { + return this.innerModel().hybridAksExtendedLocation(); + } + + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public Long manualActionCount() { + return this.innerModel().manualActionCount(); + } + + public String networkFabricId() { + return this.innerModel().networkFabricId(); + } + + public ClusterProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String supportExpiryDate() { + return this.innerModel().supportExpiryDate(); + } + + public List workloadResourceIds() { + List inner = this.innerModel().workloadResourceIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ClusterPatchParameters updateClusterUpdateParameters; + + public ClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + this.updateClusterUpdateParameters = new ClusterPatchParameters(); + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, updateClusterUpdateParameters, Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterName, updateClusterUpdateParameters, context); + return this; + } + + ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public void deploy() { + serviceManager.clusters().deploy(resourceGroupName, clusterName); + } + + public void deploy(ClusterDeployParameters clusterDeployParameters, Context context) { + serviceManager.clusters().deploy(resourceGroupName, clusterName, clusterDeployParameters, context); + } + + public void updateVersion(ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + serviceManager.clusters().updateVersion(resourceGroupName, clusterName, clusterUpdateVersionParameters); + } + + public void updateVersion(ClusterUpdateVersionParameters clusterUpdateVersionParameters, Context context) { + serviceManager + .clusters() + .updateVersion(resourceGroupName, clusterName, clusterUpdateVersionParameters, context); + } + + public ClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public ClusterImpl withAggregatorOrSingleRackDefinition(RackDefinition aggregatorOrSingleRackDefinition) { + if (isInCreateMode()) { + this.innerModel().withAggregatorOrSingleRackDefinition(aggregatorOrSingleRackDefinition); + return this; + } else { + this.updateClusterUpdateParameters.withAggregatorOrSingleRackDefinition(aggregatorOrSingleRackDefinition); + return this; + } + } + + public ClusterImpl withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + this.innerModel().withAnalyticsWorkspaceId(analyticsWorkspaceId); + return this; + } + + public ClusterImpl withClusterType(ClusterType clusterType) { + this.innerModel().withClusterType(clusterType); + return this; + } + + public ClusterImpl withClusterVersion(String clusterVersion) { + this.innerModel().withClusterVersion(clusterVersion); + return this; + } + + public ClusterImpl withNetworkFabricId(String networkFabricId) { + this.innerModel().withNetworkFabricId(networkFabricId); + return this; + } + + public ClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateClusterUpdateParameters.withTags(tags); + return this; + } + } + + public ClusterImpl withClusterLocation(String clusterLocation) { + if (isInCreateMode()) { + this.innerModel().withClusterLocation(clusterLocation); + return this; + } else { + this.updateClusterUpdateParameters.withClusterLocation(clusterLocation); + return this; + } + } + + public ClusterImpl withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal) { + if (isInCreateMode()) { + this.innerModel().withClusterServicePrincipal(clusterServicePrincipal); + return this; + } else { + this.updateClusterUpdateParameters.withClusterServicePrincipal(clusterServicePrincipal); + return this; + } + } + + public ClusterImpl withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) { + if (isInCreateMode()) { + this.innerModel().withComputeDeploymentThreshold(computeDeploymentThreshold); + return this; + } else { + this.updateClusterUpdateParameters.withComputeDeploymentThreshold(computeDeploymentThreshold); + return this; + } + } + + public ClusterImpl withComputeRackDefinitions(List computeRackDefinitions) { + if (isInCreateMode()) { + this.innerModel().withComputeRackDefinitions(computeRackDefinitions); + return this; + } else { + this.updateClusterUpdateParameters.withComputeRackDefinitions(computeRackDefinitions); + return this; + } + } + + public ClusterImpl withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java new file mode 100644 index 000000000000..fd35d0a36dac --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagerImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.models.ClusterAvailableVersion; +import com.azure.resourcemanager.networkcloud.models.ClusterManager; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ClusterManagerImpl implements ClusterManager, ClusterManager.Definition, ClusterManager.Update { + private ClusterManagerInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String analyticsWorkspaceId() { + return this.innerModel().analyticsWorkspaceId(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List clusterVersions() { + List inner = this.innerModel().clusterVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterManagerDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public String fabricControllerId() { + return this.innerModel().fabricControllerId(); + } + + public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public ExtendedLocation managerExtendedLocation() { + return this.innerModel().managerExtendedLocation(); + } + + public ClusterManagerProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterManagerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterManagerName; + + private ClusterManagerPatchParameters updateClusterManagerUpdateParameters; + + public ClusterManagerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ClusterManager create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterManagers() + .createOrUpdate(resourceGroupName, clusterManagerName, this.innerModel(), Context.NONE); + return this; + } + + public ClusterManager create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterManagers() + .createOrUpdate(resourceGroupName, clusterManagerName, this.innerModel(), context); + return this; + } + + ClusterManagerImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new ClusterManagerInner(); + this.serviceManager = serviceManager; + this.clusterManagerName = name; + } + + public ClusterManagerImpl update() { + this.updateClusterManagerUpdateParameters = new ClusterManagerPatchParameters(); + return this; + } + + public ClusterManager apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterManagers() + .updateWithResponse( + resourceGroupName, clusterManagerName, updateClusterManagerUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public ClusterManager apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterManagers() + .updateWithResponse( + resourceGroupName, clusterManagerName, updateClusterManagerUpdateParameters, context) + .getValue(); + return this; + } + + ClusterManagerImpl( + ClusterManagerInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterManagerName = Utils.getValueFromIdByName(innerObject.id(), "clusterManagers"); + } + + public ClusterManager refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterManagers() + .getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, Context.NONE) + .getValue(); + return this; + } + + public ClusterManager refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterManagers() + .getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, context) + .getValue(); + return this; + } + + public ClusterManagerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterManagerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterManagerImpl withFabricControllerId(String fabricControllerId) { + this.innerModel().withFabricControllerId(fabricControllerId); + return this; + } + + public ClusterManagerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateClusterManagerUpdateParameters.withTags(tags); + return this; + } + } + + public ClusterManagerImpl withAnalyticsWorkspaceId(String analyticsWorkspaceId) { + this.innerModel().withAnalyticsWorkspaceId(analyticsWorkspaceId); + return this; + } + + public ClusterManagerImpl withAvailabilityZones(List availabilityZones) { + this.innerModel().withAvailabilityZones(availabilityZones); + return this; + } + + public ClusterManagerImpl withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + public ClusterManagerImpl withVmSize(String vmSize) { + this.innerModel().withVmSize(vmSize); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java new file mode 100644 index 000000000000..ae89e45da5fa --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersClientImpl.java @@ -0,0 +1,1573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.ClusterManagersClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerList; +import com.azure.resourcemanager.networkcloud.models.ClusterManagerPatchParameters; +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 ClusterManagersClient. */ +public final class ClusterManagersClientImpl implements ClusterManagersClient { + /** The proxy service used to perform REST calls. */ + private final ClusterManagersService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of ClusterManagersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterManagersClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(ClusterManagersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudClusterManagers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudClusterM") + public interface ClusterManagersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterManagerName") String clusterManagerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterManagerName") String clusterManagerName, + @BodyParam("application/json") ClusterManagerInner clusterManagerParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterManagerName") String clusterManagerName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterManagerName") String clusterManagerName, + @BodyParam("application/json") ClusterManagerPatchParameters clusterManagerUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 list of cluster managers in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 list of cluster managers in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 list of cluster managers in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 list of cluster managers in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cluster managers in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cluster managers in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cluster managers in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cluster managers in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cluster managers in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of cluster managers in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterManagerName) { + 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterManagerName, 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + accept, + context); + } + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterManagerName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterManagerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterManagerName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterManagerName, context).block(); + } + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterManagerInner getByResourceGroup(String resourceGroupName, String clusterManagerName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, Context.NONE).getValue(); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters) { + 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + if (clusterManagerParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter clusterManagerParameters is required and cannot be null.")); + } else { + clusterManagerParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + clusterManagerParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + if (clusterManagerParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter clusterManagerParameters is required and cannot be null.")); + } else { + clusterManagerParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + clusterManagerParameters, + accept, + context); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more + * on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterManagerInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterManagerName, clusterManagerParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterManagerInner.class, + ClusterManagerInner.class, + this.client.getContext()); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more + * on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterManagerInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterManagerName, clusterManagerParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterManagerInner.class, ClusterManagerInner.class, context); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more + * on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterManagerInner> beginCreateOrUpdate( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, clusterManagerName, clusterManagerParameters) + .getSyncPoller(); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more + * on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterManagerInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, clusterManagerName, clusterManagerParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterManagerName, clusterManagerParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterManagerName, clusterManagerParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterManagerInner createOrUpdate( + String resourceGroupName, String clusterManagerName, ClusterManagerInner clusterManagerParameters) { + return createOrUpdateAsync(resourceGroupName, clusterManagerName, clusterManagerParameters).block(); + } + + /** + * Create or update the cluster manager. + * + *

Create a new cluster manager or update properties of the cluster manager if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterManagerInner createOrUpdate( + String resourceGroupName, + String clusterManagerName, + ClusterManagerInner clusterManagerParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, clusterManagerName, clusterManagerParameters, context).block(); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String clusterManagerName) { + 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String clusterManagerName, 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + accept, + context); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterManagerName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterManagerName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName) { + return this.beginDeleteAsync(resourceGroupName, clusterManagerName).getSyncPoller(); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterManagerName, context).getSyncPoller(); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName) { + return beginDeleteAsync(resourceGroupName, clusterManagerName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManagerName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterManagerName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 delete(String resourceGroupName, String clusterManagerName) { + deleteAsync(resourceGroupName, clusterManagerName).block(); + } + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 delete(String resourceGroupName, String clusterManagerName, Context context) { + deleteAsync(resourceGroupName, clusterManagerName, context).block(); + } + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerUpdateParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String clusterManagerName, + ClusterManagerPatchParameters clusterManagerUpdateParameters) { + 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + if (clusterManagerUpdateParameters != null) { + clusterManagerUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + clusterManagerUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerUpdateParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String clusterManagerName, + ClusterManagerPatchParameters clusterManagerUpdateParameters, + 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 (clusterManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterManagerName is required and cannot be null.")); + } + if (clusterManagerUpdateParameters != null) { + clusterManagerUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterManagerName, + clusterManagerUpdateParameters, + accept, + context); + } + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterManagerName) { + final ClusterManagerPatchParameters clusterManagerUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, clusterManagerName, clusterManagerUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @param clusterManagerUpdateParameters The request body. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String clusterManagerName, + ClusterManagerPatchParameters clusterManagerUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, clusterManagerName, clusterManagerUpdateParameters, context) + .block(); + } + + /** + * Patch the cluster manager. + * + *

Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 clusterManager represents a control-plane to manage one or more on-premises clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterManagerInner update(String resourceGroupName, String clusterManagerName) { + final ClusterManagerPatchParameters clusterManagerUpdateParameters = null; + return updateWithResponse(resourceGroupName, clusterManagerName, clusterManagerUpdateParameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterManagerList represents a list of cluster manager objects along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java new file mode 100644 index 000000000000..579c9bd5d6e7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterManagersImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.ClusterManagersClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.azure.resourcemanager.networkcloud.models.ClusterManager; +import com.azure.resourcemanager.networkcloud.models.ClusterManagers; + +public final class ClusterManagersImpl implements ClusterManagers { + private static final ClientLogger LOGGER = new ClientLogger(ClusterManagersImpl.class); + + private final ClusterManagersClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public ClusterManagersImpl( + ClusterManagersClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ClusterManagerImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterManagerName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterManagerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterManager getByResourceGroup(String resourceGroupName, String clusterManagerName) { + ClusterManagerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterManagerName); + if (inner != null) { + return new ClusterManagerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterManagerName) { + this.serviceClient().delete(resourceGroupName, clusterManagerName); + } + + public void delete(String resourceGroupName, String clusterManagerName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterManagerName, context); + } + + public ClusterManager getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + if (clusterManagerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + if (clusterManagerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterManagerName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + if (clusterManagerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); + } + this.delete(resourceGroupName, clusterManagerName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterManagerName = Utils.getValueFromIdByName(id, "clusterManagers"); + if (clusterManagerName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'clusterManagers'.", id))); + } + this.delete(resourceGroupName, clusterManagerName, context); + } + + private ClusterManagersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public ClusterManagerImpl define(String name) { + return new ClusterManagerImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java new file mode 100644 index 000000000000..1bf64cc914b5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClusterMetricsConfigurationImpl.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ClusterMetricsConfigurationImpl + implements ClusterMetricsConfiguration, ClusterMetricsConfiguration.Definition, ClusterMetricsConfiguration.Update { + private ClusterMetricsConfigurationInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public long collectionInterval() { + return this.innerModel().collectionInterval(); + } + + public ClusterMetricsConfigurationDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public List disabledMetrics() { + List inner = this.innerModel().disabledMetrics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List enabledMetrics() { + List inner = this.innerModel().enabledMetrics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterMetricsConfigurationProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterMetricsConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String metricsConfigurationName; + + private ClusterMetricsConfigurationPatchParameters updateMetricsConfigurationUpdateParameters; + + public ClusterMetricsConfigurationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ClusterMetricsConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getMetricsConfigurations() + .createOrUpdate( + resourceGroupName, clusterName, metricsConfigurationName, this.innerModel(), Context.NONE); + return this; + } + + public ClusterMetricsConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMetricsConfigurations() + .createOrUpdate(resourceGroupName, clusterName, metricsConfigurationName, this.innerModel(), context); + return this; + } + + ClusterMetricsConfigurationImpl( + String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new ClusterMetricsConfigurationInner(); + this.serviceManager = serviceManager; + this.metricsConfigurationName = name; + } + + public ClusterMetricsConfigurationImpl update() { + this.updateMetricsConfigurationUpdateParameters = new ClusterMetricsConfigurationPatchParameters(); + return this; + } + + public ClusterMetricsConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMetricsConfigurations() + .update( + resourceGroupName, + clusterName, + metricsConfigurationName, + updateMetricsConfigurationUpdateParameters, + Context.NONE); + return this; + } + + public ClusterMetricsConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMetricsConfigurations() + .update( + resourceGroupName, + clusterName, + metricsConfigurationName, + updateMetricsConfigurationUpdateParameters, + context); + return this; + } + + ClusterMetricsConfigurationImpl( + ClusterMetricsConfigurationInner innerObject, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.metricsConfigurationName = Utils.getValueFromIdByName(innerObject.id(), "metricsConfigurations"); + } + + public ClusterMetricsConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMetricsConfigurations() + .getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public ClusterMetricsConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMetricsConfigurations() + .getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, context) + .getValue(); + return this; + } + + public ClusterMetricsConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterMetricsConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterMetricsConfigurationImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public ClusterMetricsConfigurationImpl withCollectionInterval(long collectionInterval) { + this.innerModel().withCollectionInterval(collectionInterval); + return this; + } + + public ClusterMetricsConfigurationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateMetricsConfigurationUpdateParameters.withTags(tags); + return this; + } + } + + public ClusterMetricsConfigurationImpl withEnabledMetrics(List enabledMetrics) { + if (isInCreateMode()) { + this.innerModel().withEnabledMetrics(enabledMetrics); + return this; + } else { + this.updateMetricsConfigurationUpdateParameters.withEnabledMetrics(enabledMetrics); + return this; + } + } + + public ClusterMetricsConfigurationImpl withCollectionInterval(Long collectionInterval) { + this.updateMetricsConfigurationUpdateParameters.withCollectionInterval(collectionInterval); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java new file mode 100644 index 000000000000..c1616d6a7d1d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersClientImpl.java @@ -0,0 +1,2347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.ClustersClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; +import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterList; +import com.azure.resourcemanager.networkcloud.models.ClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; +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. */ +public final class ClustersClientImpl implements ClustersClient { + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(NetworkCloudImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudClusters to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudClusters") + public interface ClustersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterInner clusterParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterPatchParameters clusterUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deploy( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterDeployParameters clusterDeployParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateVersion( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterUpdateVersionParameters clusterUpdateVersionParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 list of clusters in the provided subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 list of clusters in the provided subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 list of clusters in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 list of clusters in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 list of clusters in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 list of clusters in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of clusters in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of clusters in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of clusters in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of clusters in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of clusters in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of clusters in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + 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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + 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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context); + } + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner clusterParameters) { + 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 (clusterParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterParameters is required and cannot be null.")); + } else { + clusterParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, 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 (clusterParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterParameters is required and cannot be null.")); + } else { + clusterParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterParameters, + accept, + context); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner clusterParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, clusterParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, clusterParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner clusterParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, clusterParameters).getSyncPoller(); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, clusterName, clusterParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner clusterParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, clusterParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, clusterParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner clusterParameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, clusterParameters).block(); + } + + /** + * Create or update the cluster. + * + *

Create a new cluster or update the properties of the cluster if it exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ClusterInner clusterParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, clusterParameters, context).block(); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(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 + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + 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 + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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 the cluster. + * + *

Delete the provided 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 the cluster. + * + *

Delete the provided 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 this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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 this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete the cluster. + * + *

Delete the provided 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters) { + 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 (clusterUpdateParameters != null) { + clusterUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, 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 (clusterUpdateParameters != null) { + clusterUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterUpdateParameters, + accept, + context); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, clusterUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName) { + final ClusterPatchParameters clusterUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, clusterUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, clusterUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName) { + final ClusterPatchParameters clusterUpdateParameters = null; + return this.beginUpdateAsync(resourceGroupName, clusterName, clusterUpdateParameters).getSyncPoller(); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, clusterName, clusterUpdateParameters, context).getSyncPoller(); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters) { + return beginUpdateAsync(resourceGroupName, clusterName, clusterUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @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 represents the on-premises Network Cloud cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName) { + final ClusterPatchParameters clusterUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, clusterName, clusterUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, clusterUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName) { + final ClusterPatchParameters clusterUpdateParameters = null; + return updateAsync(resourceGroupName, clusterName, clusterUpdateParameters).block(); + } + + /** + * Patch the cluster. + * + *

Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and + * tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateParameters The request body. + * @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 represents the on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, String clusterName, ClusterPatchParameters clusterUpdateParameters, Context context) { + return updateAsync(resourceGroupName, clusterName, clusterUpdateParameters, context).block(); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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>> deployWithResponseAsync( + String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters) { + 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 (clusterDeployParameters != null) { + clusterDeployParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deploy( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterDeployParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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>> deployWithResponseAsync( + String resourceGroupName, + String clusterName, + ClusterDeployParameters clusterDeployParameters, + 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 (clusterDeployParameters != null) { + clusterDeployParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deploy( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterDeployParameters, + accept, + context); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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> beginDeployAsync( + String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters) { + Mono>> mono = + deployWithResponseAsync(resourceGroupName, clusterName, clusterDeployParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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> beginDeployAsync(String resourceGroupName, String clusterName) { + final ClusterDeployParameters clusterDeployParameters = null; + Mono>> mono = + deployWithResponseAsync(resourceGroupName, clusterName, clusterDeployParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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> beginDeployAsync( + String resourceGroupName, + String clusterName, + ClusterDeployParameters clusterDeployParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deployWithResponseAsync(resourceGroupName, clusterName, clusterDeployParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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> beginDeploy(String resourceGroupName, String clusterName) { + final ClusterDeployParameters clusterDeployParameters = null; + return this.beginDeployAsync(resourceGroupName, clusterName, clusterDeployParameters).getSyncPoller(); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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> beginDeploy( + String resourceGroupName, + String clusterName, + ClusterDeployParameters clusterDeployParameters, + Context context) { + return this.beginDeployAsync(resourceGroupName, clusterName, clusterDeployParameters, context).getSyncPoller(); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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 deployAsync( + String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters) { + return beginDeployAsync(resourceGroupName, clusterName, clusterDeployParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployAsync(String resourceGroupName, String clusterName) { + final ClusterDeployParameters clusterDeployParameters = null; + return beginDeployAsync(resourceGroupName, clusterName, clusterDeployParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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 deployAsync( + String resourceGroupName, + String clusterName, + ClusterDeployParameters clusterDeployParameters, + Context context) { + return beginDeployAsync(resourceGroupName, clusterName, clusterDeployParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deploy(String resourceGroupName, String clusterName) { + final ClusterDeployParameters clusterDeployParameters = null; + deployAsync(resourceGroupName, clusterName, clusterDeployParameters).block(); + } + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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 deploy( + String resourceGroupName, + String clusterName, + ClusterDeployParameters clusterDeployParameters, + Context context) { + deployAsync(resourceGroupName, clusterName, clusterDeployParameters, context).block(); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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>> updateVersionWithResponseAsync( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + 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 (clusterUpdateVersionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter clusterUpdateVersionParameters is required and cannot be null.")); + } else { + clusterUpdateVersionParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateVersion( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterUpdateVersionParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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>> updateVersionWithResponseAsync( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + 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 (clusterUpdateVersionParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter clusterUpdateVersionParameters is required and cannot be null.")); + } else { + clusterUpdateVersionParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateVersion( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + clusterUpdateVersionParameters, + accept, + context); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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> beginUpdateVersionAsync( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + Mono>> mono = + updateVersionWithResponseAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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> beginUpdateVersionAsync( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateVersionWithResponseAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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> beginUpdateVersion( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + return this + .beginUpdateVersionAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters) + .getSyncPoller(); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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> beginUpdateVersion( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context) { + return this + .beginUpdateVersionAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters, context) + .getSyncPoller(); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersionAsync( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + return beginUpdateVersionAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersionAsync( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context) { + return beginUpdateVersionAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + updateVersionAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters).block(); + } + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context) { + updateVersionAsync(resourceGroupName, clusterName, clusterUpdateVersionParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterList represents a list of clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java new file mode 100644 index 000000000000..86411ac2b145 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ClustersImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.ClustersClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; +import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; +import com.azure.resourcemanager.networkcloud.models.Clusters; + +public final class ClustersImpl implements Clusters { + private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public ClustersImpl( + ClustersClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public void deploy(String resourceGroupName, String clusterName) { + this.serviceClient().deploy(resourceGroupName, clusterName); + } + + public void deploy( + String resourceGroupName, + String clusterName, + ClusterDeployParameters clusterDeployParameters, + Context context) { + this.serviceClient().deploy(resourceGroupName, clusterName, clusterDeployParameters, context); + } + + public void updateVersion( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters) { + this.serviceClient().updateVersion(resourceGroupName, clusterName, clusterUpdateVersionParameters); + } + + public void updateVersion( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context) { + this.serviceClient().updateVersion(resourceGroupName, clusterName, clusterUpdateVersionParameters, context); + } + + public Cluster getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java new file mode 100644 index 000000000000..fa7a4538f3bd --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsoleImpl.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.models.Console; +import com.azure.resourcemanager.networkcloud.models.ConsoleDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.ConsolePatchParameters; +import com.azure.resourcemanager.networkcloud.models.ConsoleProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class ConsoleImpl implements Console, Console.Definition, Console.Update { + private ConsoleInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ConsoleDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public ConsoleEnabled enabled() { + return this.innerModel().enabled(); + } + + public OffsetDateTime expiration() { + return this.innerModel().expiration(); + } + + public String privateLinkServiceId() { + return this.innerModel().privateLinkServiceId(); + } + + public ConsoleProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SshPublicKey sshPublicKey() { + return this.innerModel().sshPublicKey(); + } + + public String virtualMachineAccessId() { + return this.innerModel().virtualMachineAccessId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConsoleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualMachineName; + + private String consoleName; + + private ConsolePatchParameters updateConsoleUpdateParameters; + + public ConsoleImpl withExistingVirtualMachine(String resourceGroupName, String virtualMachineName) { + this.resourceGroupName = resourceGroupName; + this.virtualMachineName = virtualMachineName; + return this; + } + + public Console create() { + this.innerObject = + serviceManager + .serviceClient() + .getConsoles() + .createOrUpdate(resourceGroupName, virtualMachineName, consoleName, this.innerModel(), Context.NONE); + return this; + } + + public Console create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConsoles() + .createOrUpdate(resourceGroupName, virtualMachineName, consoleName, this.innerModel(), context); + return this; + } + + ConsoleImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new ConsoleInner(); + this.serviceManager = serviceManager; + this.consoleName = name; + } + + public ConsoleImpl update() { + this.updateConsoleUpdateParameters = new ConsolePatchParameters(); + return this; + } + + public Console apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConsoles() + .update( + resourceGroupName, virtualMachineName, consoleName, updateConsoleUpdateParameters, Context.NONE); + return this; + } + + public Console apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConsoles() + .update(resourceGroupName, virtualMachineName, consoleName, updateConsoleUpdateParameters, context); + return this; + } + + ConsoleImpl(ConsoleInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + this.consoleName = Utils.getValueFromIdByName(innerObject.id(), "consoles"); + } + + public Console refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConsoles() + .getWithResponse(resourceGroupName, virtualMachineName, consoleName, Context.NONE) + .getValue(); + return this; + } + + public Console refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConsoles() + .getWithResponse(resourceGroupName, virtualMachineName, consoleName, context) + .getValue(); + return this; + } + + public ConsoleImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConsoleImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConsoleImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public ConsoleImpl withEnabled(ConsoleEnabled enabled) { + if (isInCreateMode()) { + this.innerModel().withEnabled(enabled); + return this; + } else { + this.updateConsoleUpdateParameters.withEnabled(enabled); + return this; + } + } + + public ConsoleImpl withSshPublicKey(SshPublicKey sshPublicKey) { + if (isInCreateMode()) { + this.innerModel().withSshPublicKey(sshPublicKey); + return this; + } else { + this.updateConsoleUpdateParameters.withSshPublicKey(sshPublicKey); + return this; + } + } + + public ConsoleImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateConsoleUpdateParameters.withTags(tags); + return this; + } + } + + public ConsoleImpl withExpiration(OffsetDateTime expiration) { + if (isInCreateMode()) { + this.innerModel().withExpiration(expiration); + return this; + } else { + this.updateConsoleUpdateParameters.withExpiration(expiration); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java new file mode 100644 index 000000000000..615326729c4f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesClientImpl.java @@ -0,0 +1,1614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.ConsolesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.models.ConsoleList; +import com.azure.resourcemanager.networkcloud.models.ConsolePatchParameters; +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 ConsolesClient. */ +public final class ConsolesClientImpl implements ConsolesClient { + /** The proxy service used to perform REST calls. */ + private final ConsolesService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of ConsolesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConsolesClientImpl(NetworkCloudImpl client) { + this.service = RestProxy.create(ConsolesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudConsoles to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudConsoles") + public interface ConsolesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @PathParam("consoleName") String consoleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @PathParam("consoleName") String consoleName, + @BodyParam("application/json") ConsoleInner consoleParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @PathParam("consoleName") String consoleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @PathParam("consoleName") String consoleName, + @BodyParam("application/json") ConsolePatchParameters consoleUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 list of virtual machine consoles in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 list of virtual machine consoles in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String virtualMachineName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, virtualMachineName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String virtualMachineName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, virtualMachineName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String virtualMachineName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, virtualMachineName)); + } + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String virtualMachineName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, virtualMachineName, context)); + } + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualMachineName, String consoleName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String virtualMachineName, String consoleName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + accept, + context); + } + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualMachineName, String consoleName) { + return getWithResponseAsync(resourceGroupName, virtualMachineName, consoleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String virtualMachineName, String consoleName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualMachineName, consoleName, context).block(); + } + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsoleInner get(String resourceGroupName, String virtualMachineName, String consoleName) { + return getWithResponse(resourceGroupName, virtualMachineName, consoleName, Context.NONE).getValue(); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + if (consoleParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter consoleParameters is required and cannot be null.")); + } else { + consoleParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + if (consoleParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter consoleParameters is required and cannot be null.")); + } else { + consoleParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + consoleParameters, + accept, + context); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConsoleInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConsoleInner.class, ConsoleInner.class, this.client.getContext()); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConsoleInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, virtualMachineName, consoleName, consoleParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConsoleInner.class, ConsoleInner.class, context); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConsoleInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters) + .getSyncPoller(); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConsoleInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsoleInner createOrUpdate( + String resourceGroupName, String virtualMachineName, String consoleName, ConsoleInner consoleParameters) { + return createOrUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters).block(); + } + + /** + * Create or update the virtual machine console. + * + *

Create a new virtual machine console or update the properties of the existing virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsoleInner createOrUpdate( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsoleInner consoleParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleParameters, context) + .block(); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String virtualMachineName, String consoleName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String virtualMachineName, String consoleName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + accept, + context); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualMachineName, consoleName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, virtualMachineName, consoleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName) { + return this.beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName).getSyncPoller(); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName, context).getSyncPoller(); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName) { + return beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 virtualMachineName, String consoleName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualMachineName, consoleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 delete(String resourceGroupName, String virtualMachineName, String consoleName) { + deleteAsync(resourceGroupName, virtualMachineName, consoleName).block(); + } + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context) { + deleteAsync(resourceGroupName, virtualMachineName, consoleName, context).block(); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + if (consoleUpdateParameters != null) { + consoleUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + consoleUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (consoleName == null) { + return Mono.error(new IllegalArgumentException("Parameter consoleName is required and cannot be null.")); + } + if (consoleUpdateParameters != null) { + consoleUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + consoleName, + consoleUpdateParameters, + accept, + context); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConsoleInner> beginUpdateAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConsoleInner.class, ConsoleInner.class, this.client.getContext()); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConsoleInner> beginUpdateAsync( + String resourceGroupName, String virtualMachineName, String consoleName) { + final ConsolePatchParameters consoleUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConsoleInner.class, ConsoleInner.class, this.client.getContext()); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConsoleInner> beginUpdateAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConsoleInner.class, ConsoleInner.class, context); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConsoleInner> beginUpdate( + String resourceGroupName, String virtualMachineName, String consoleName) { + final ConsolePatchParameters consoleUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud + * virtual machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConsoleInner> beginUpdate( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters) { + return beginUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 console represents the console of an on-premises Network Cloud virtual machine on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String virtualMachineName, String consoleName) { + final ConsolePatchParameters consoleUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsoleInner update(String resourceGroupName, String virtualMachineName, String consoleName) { + final ConsolePatchParameters consoleUpdateParameters = null; + return updateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters).block(); + } + + /** + * Patch the virtual machine console. + * + *

Patch the properties of the provided virtual machine console, or update the tags associated with the virtual + * machine console. Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @param consoleUpdateParameters The request body. + * @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 console represents the console of an on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConsoleInner update( + String resourceGroupName, + String virtualMachineName, + String consoleName, + ConsolePatchParameters consoleUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, virtualMachineName, consoleName, consoleUpdateParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 consoleList represents a list of virtual machine consoles along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 consoleList represents a list of virtual machine consoles along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java new file mode 100644 index 000000000000..fa000179d7f4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/ConsolesImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.ConsolesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.azure.resourcemanager.networkcloud.models.Console; +import com.azure.resourcemanager.networkcloud.models.Consoles; + +public final class ConsolesImpl implements Consoles { + private static final ClientLogger LOGGER = new ClientLogger(ConsolesImpl.class); + + private final ConsolesClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public ConsolesImpl( + ConsolesClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String virtualMachineName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, virtualMachineName); + return Utils.mapPage(inner, inner1 -> new ConsoleImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String virtualMachineName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, virtualMachineName, context); + return Utils.mapPage(inner, inner1 -> new ConsoleImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String virtualMachineName, String consoleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, virtualMachineName, consoleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConsoleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Console get(String resourceGroupName, String virtualMachineName, String consoleName) { + ConsoleInner inner = this.serviceClient().get(resourceGroupName, virtualMachineName, consoleName); + if (inner != null) { + return new ConsoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualMachineName, String consoleName) { + this.serviceClient().delete(resourceGroupName, virtualMachineName, consoleName); + } + + public void delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualMachineName, consoleName, context); + } + + public Console getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String consoleName = Utils.getValueFromIdByName(id, "consoles"); + if (consoleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualMachineName, consoleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String consoleName = Utils.getValueFromIdByName(id, "consoles"); + if (consoleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualMachineName, consoleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String consoleName = Utils.getValueFromIdByName(id, "consoles"); + if (consoleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); + } + this.delete(resourceGroupName, virtualMachineName, consoleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + String consoleName = Utils.getValueFromIdByName(id, "consoles"); + if (consoleName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'consoles'.", id))); + } + this.delete(resourceGroupName, virtualMachineName, consoleName, context); + } + + private ConsolesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public ConsoleImpl define(String name) { + return new ConsoleImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworkImpl.java new file mode 100644 index 000000000000..30b49bc32d3c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworkImpl.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.DefaultCniNetworkInner; +import com.azure.resourcemanager.networkcloud.models.BgpPeer; +import com.azure.resourcemanager.networkcloud.models.CniBgpConfiguration; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetwork; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkPatchParameters; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkProvisioningState; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DefaultCniNetworkImpl + implements DefaultCniNetwork, DefaultCniNetwork.Definition, DefaultCniNetwork.Update { + private DefaultCniNetworkInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public Long cniAsNumber() { + return this.innerModel().cniAsNumber(); + } + + public CniBgpConfiguration cniBgpConfiguration() { + return this.innerModel().cniBgpConfiguration(); + } + + public DefaultCniNetworkDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public List fabricBgpPeers() { + List inner = this.innerModel().fabricBgpPeers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List hybridAksClustersAssociatedIds() { + List inner = this.innerModel().hybridAksClustersAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public IpAllocationType ipAllocationType() { + return this.innerModel().ipAllocationType(); + } + + public String ipv4ConnectedPrefix() { + return this.innerModel().ipv4ConnectedPrefix(); + } + + public String ipv6ConnectedPrefix() { + return this.innerModel().ipv6ConnectedPrefix(); + } + + public String l3IsolationDomainId() { + return this.innerModel().l3IsolationDomainId(); + } + + public DefaultCniNetworkProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public long vlan() { + return this.innerModel().vlan(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DefaultCniNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String defaultCniNetworkName; + + private DefaultCniNetworkPatchParameters updateDefaultCniNetworkUpdateParameters; + + public DefaultCniNetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DefaultCniNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultCniNetworks() + .createOrUpdate(resourceGroupName, defaultCniNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public DefaultCniNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultCniNetworks() + .createOrUpdate(resourceGroupName, defaultCniNetworkName, this.innerModel(), context); + return this; + } + + DefaultCniNetworkImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new DefaultCniNetworkInner(); + this.serviceManager = serviceManager; + this.defaultCniNetworkName = name; + } + + public DefaultCniNetworkImpl update() { + this.updateDefaultCniNetworkUpdateParameters = new DefaultCniNetworkPatchParameters(); + return this; + } + + public DefaultCniNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultCniNetworks() + .updateWithResponse( + resourceGroupName, defaultCniNetworkName, updateDefaultCniNetworkUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public DefaultCniNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultCniNetworks() + .updateWithResponse( + resourceGroupName, defaultCniNetworkName, updateDefaultCniNetworkUpdateParameters, context) + .getValue(); + return this; + } + + DefaultCniNetworkImpl( + DefaultCniNetworkInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.defaultCniNetworkName = Utils.getValueFromIdByName(innerObject.id(), "defaultCniNetworks"); + } + + public DefaultCniNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultCniNetworks() + .getByResourceGroupWithResponse(resourceGroupName, defaultCniNetworkName, Context.NONE) + .getValue(); + return this; + } + + public DefaultCniNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDefaultCniNetworks() + .getByResourceGroupWithResponse(resourceGroupName, defaultCniNetworkName, context) + .getValue(); + return this; + } + + public DefaultCniNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DefaultCniNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DefaultCniNetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public DefaultCniNetworkImpl withL3IsolationDomainId(String l3IsolationDomainId) { + this.innerModel().withL3IsolationDomainId(l3IsolationDomainId); + return this; + } + + public DefaultCniNetworkImpl withVlan(long vlan) { + this.innerModel().withVlan(vlan); + return this; + } + + public DefaultCniNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateDefaultCniNetworkUpdateParameters.withTags(tags); + return this; + } + } + + public DefaultCniNetworkImpl withCniBgpConfiguration(CniBgpConfiguration cniBgpConfiguration) { + this.innerModel().withCniBgpConfiguration(cniBgpConfiguration); + return this; + } + + public DefaultCniNetworkImpl withIpAllocationType(IpAllocationType ipAllocationType) { + this.innerModel().withIpAllocationType(ipAllocationType); + return this; + } + + public DefaultCniNetworkImpl withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { + this.innerModel().withIpv4ConnectedPrefix(ipv4ConnectedPrefix); + return this; + } + + public DefaultCniNetworkImpl withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { + this.innerModel().withIpv6ConnectedPrefix(ipv6ConnectedPrefix); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworksClientImpl.java new file mode 100644 index 000000000000..6a4756b1a081 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworksClientImpl.java @@ -0,0 +1,1588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.DefaultCniNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.DefaultCniNetworkInner; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkList; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworkPatchParameters; +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 DefaultCniNetworksClient. */ +public final class DefaultCniNetworksClientImpl implements DefaultCniNetworksClient { + /** The proxy service used to perform REST calls. */ + private final DefaultCniNetworksService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of DefaultCniNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DefaultCniNetworksClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(DefaultCniNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudDefaultCniNetworks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudDefaultC") + public interface DefaultCniNetworksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/defaultCniNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("defaultCniNetworkName") String defaultCniNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("defaultCniNetworkName") String defaultCniNetworkName, + @BodyParam("application/json") DefaultCniNetworkInner defaultCniNetworkParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("defaultCniNetworkName") String defaultCniNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/defaultCniNetworks/{defaultCniNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("defaultCniNetworkName") String defaultCniNetworkName, + @BodyParam("application/json") DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 list of default CNI networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 list of default CNI networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 list of default CNI networks in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 list of default CNI networks in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 list of default CNI networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 list of default CNI networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of default CNI networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of default CNI networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of default CNI networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of default CNI networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of default CNI networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of default CNI networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String defaultCniNetworkName) { + 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String defaultCniNetworkName, 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + accept, + context); + } + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String defaultCniNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, defaultCniNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String defaultCniNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, defaultCniNetworkName, context).block(); + } + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultCniNetworkInner getByResourceGroup(String resourceGroupName, String defaultCniNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, defaultCniNetworkName, Context.NONE).getValue(); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters) { + 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + if (defaultCniNetworkParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter defaultCniNetworkParameters is required and cannot be null.")); + } else { + defaultCniNetworkParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + if (defaultCniNetworkParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter defaultCniNetworkParameters is required and cannot be null.")); + } else { + defaultCniNetworkParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkParameters, + accept, + context); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the + * default CNI (pod) network that is created in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DefaultCniNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DefaultCniNetworkInner.class, + DefaultCniNetworkInner.class, + this.client.getContext()); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the + * default CNI (pod) network that is created in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DefaultCniNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DefaultCniNetworkInner.class, + DefaultCniNetworkInner.class, + context); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the + * default CNI (pod) network that is created in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DefaultCniNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters) + .getSyncPoller(); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the + * default CNI (pod) network that is created in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DefaultCniNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultCniNetworkInner createOrUpdate( + String resourceGroupName, String defaultCniNetworkName, DefaultCniNetworkInner defaultCniNetworkParameters) { + return createOrUpdateAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters).block(); + } + + /** + * Create or update the default CNI network. + * + *

Create a new default CNI network or update the properties of the existing default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultCniNetworkInner createOrUpdate( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkInner defaultCniNetworkParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkParameters, context) + .block(); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String defaultCniNetworkName) { + 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String defaultCniNetworkName, 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + accept, + context); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, defaultCniNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, defaultCniNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName) { + return this.beginDeleteAsync(resourceGroupName, defaultCniNetworkName).getSyncPoller(); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName, Context context) { + return this.beginDeleteAsync(resourceGroupName, defaultCniNetworkName, context).getSyncPoller(); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName) { + return beginDeleteAsync(resourceGroupName, defaultCniNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, defaultCniNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 delete(String resourceGroupName, String defaultCniNetworkName) { + deleteAsync(resourceGroupName, defaultCniNetworkName).block(); + } + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 delete(String resourceGroupName, String defaultCniNetworkName, Context context) { + deleteAsync(resourceGroupName, defaultCniNetworkName, context).block(); + } + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkUpdateParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters) { + 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + if (defaultCniNetworkUpdateParameters != null) { + defaultCniNetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkUpdateParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters, + 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 (defaultCniNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter defaultCniNetworkName is required and cannot be null.")); + } + if (defaultCniNetworkUpdateParameters != null) { + defaultCniNetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + defaultCniNetworkName, + defaultCniNetworkUpdateParameters, + accept, + context); + } + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String defaultCniNetworkName) { + final DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, defaultCniNetworkName, defaultCniNetworkUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @param defaultCniNetworkUpdateParameters The request body. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String defaultCniNetworkName, + DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, defaultCniNetworkName, defaultCniNetworkUpdateParameters, context) + .block(); + } + + /** + * Patch the default CNI network. + * + *

Update tags associated with the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 defaultCniNetwork represents the user-managed portions of the default CNI (pod) network that is created + * in support of a Hybrid AKS Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DefaultCniNetworkInner update(String resourceGroupName, String defaultCniNetworkName) { + final DefaultCniNetworkPatchParameters defaultCniNetworkUpdateParameters = null; + return updateWithResponse( + resourceGroupName, defaultCniNetworkName, defaultCniNetworkUpdateParameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 defaultCniNetworkList represents a list of default CNI networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 defaultCniNetworkList represents a list of default CNI networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 defaultCniNetworkList represents a list of default CNI networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 defaultCniNetworkList represents a list of default CNI networks along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworksImpl.java new file mode 100644 index 000000000000..440a22855420 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/DefaultCniNetworksImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.DefaultCniNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.DefaultCniNetworkInner; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetwork; +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetworks; + +public final class DefaultCniNetworksImpl implements DefaultCniNetworks { + private static final ClientLogger LOGGER = new ClientLogger(DefaultCniNetworksImpl.class); + + private final DefaultCniNetworksClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public DefaultCniNetworksImpl( + DefaultCniNetworksClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DefaultCniNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DefaultCniNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DefaultCniNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DefaultCniNetworkImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String defaultCniNetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, defaultCniNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DefaultCniNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DefaultCniNetwork getByResourceGroup(String resourceGroupName, String defaultCniNetworkName) { + DefaultCniNetworkInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, defaultCniNetworkName); + if (inner != null) { + return new DefaultCniNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String defaultCniNetworkName) { + this.serviceClient().delete(resourceGroupName, defaultCniNetworkName); + } + + public void delete(String resourceGroupName, String defaultCniNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, defaultCniNetworkName, context); + } + + public DefaultCniNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String defaultCniNetworkName = Utils.getValueFromIdByName(id, "defaultCniNetworks"); + if (defaultCniNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'defaultCniNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, defaultCniNetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String defaultCniNetworkName = Utils.getValueFromIdByName(id, "defaultCniNetworks"); + if (defaultCniNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'defaultCniNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, defaultCniNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String defaultCniNetworkName = Utils.getValueFromIdByName(id, "defaultCniNetworks"); + if (defaultCniNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'defaultCniNetworks'.", id))); + } + this.delete(resourceGroupName, defaultCniNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String defaultCniNetworkName = Utils.getValueFromIdByName(id, "defaultCniNetworks"); + if (defaultCniNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'defaultCniNetworks'.", id))); + } + this.delete(resourceGroupName, defaultCniNetworkName, context); + } + + private DefaultCniNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public DefaultCniNetworkImpl define(String name) { + return new DefaultCniNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClusterImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClusterImpl.java new file mode 100644 index 000000000000..cf5237adb75f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClusterImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.HybridAksClusterInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksCluster; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterProvisioningState; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterRestartNodeParameters; +import com.azure.resourcemanager.networkcloud.models.NodeConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class HybridAksClusterImpl + implements HybridAksCluster, HybridAksCluster.Definition, HybridAksCluster.Update { + private HybridAksClusterInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List associatedNetworkIds() { + List inner = this.innerModel().associatedNetworkIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String cloudServicesNetworkId() { + return this.innerModel().cloudServicesNetworkId(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public long controlPlaneCount() { + return this.innerModel().controlPlaneCount(); + } + + public List controlPlaneNodes() { + List inner = this.innerModel().controlPlaneNodes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String defaultCniNetworkId() { + return this.innerModel().defaultCniNetworkId(); + } + + public HybridAksClusterDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public String hybridAksProvisionedClusterId() { + return this.innerModel().hybridAksProvisionedClusterId(); + } + + public HybridAksClusterProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List volumes() { + List inner = this.innerModel().volumes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public long workerCount() { + return this.innerModel().workerCount(); + } + + public List workerNodes() { + List inner = this.innerModel().workerNodes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HybridAksClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String hybridAksClusterName; + + private HybridAksClusterPatchParameters updateHybridAksClusterUpdateParameters; + + public HybridAksClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public HybridAksCluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getHybridAksClusters() + .createOrUpdate(resourceGroupName, hybridAksClusterName, this.innerModel(), Context.NONE); + return this; + } + + public HybridAksCluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHybridAksClusters() + .createOrUpdate(resourceGroupName, hybridAksClusterName, this.innerModel(), context); + return this; + } + + HybridAksClusterImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new HybridAksClusterInner(); + this.serviceManager = serviceManager; + this.hybridAksClusterName = name; + } + + public HybridAksClusterImpl update() { + this.updateHybridAksClusterUpdateParameters = new HybridAksClusterPatchParameters(); + return this; + } + + public HybridAksCluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getHybridAksClusters() + .updateWithResponse( + resourceGroupName, hybridAksClusterName, updateHybridAksClusterUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public HybridAksCluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHybridAksClusters() + .updateWithResponse( + resourceGroupName, hybridAksClusterName, updateHybridAksClusterUpdateParameters, context) + .getValue(); + return this; + } + + HybridAksClusterImpl( + HybridAksClusterInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.hybridAksClusterName = Utils.getValueFromIdByName(innerObject.id(), "hybridAksClusters"); + } + + public HybridAksCluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getHybridAksClusters() + .getByResourceGroupWithResponse(resourceGroupName, hybridAksClusterName, Context.NONE) + .getValue(); + return this; + } + + public HybridAksCluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHybridAksClusters() + .getByResourceGroupWithResponse(resourceGroupName, hybridAksClusterName, context) + .getValue(); + return this; + } + + public void restartNode(HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + serviceManager + .hybridAksClusters() + .restartNode(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters); + } + + public void restartNode( + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, Context context) { + serviceManager + .hybridAksClusters() + .restartNode(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, context); + } + + public HybridAksClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public HybridAksClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public HybridAksClusterImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public HybridAksClusterImpl withAssociatedNetworkIds(List associatedNetworkIds) { + this.innerModel().withAssociatedNetworkIds(associatedNetworkIds); + return this; + } + + public HybridAksClusterImpl withControlPlaneCount(long controlPlaneCount) { + this.innerModel().withControlPlaneCount(controlPlaneCount); + return this; + } + + public HybridAksClusterImpl withHybridAksProvisionedClusterId(String hybridAksProvisionedClusterId) { + this.innerModel().withHybridAksProvisionedClusterId(hybridAksProvisionedClusterId); + return this; + } + + public HybridAksClusterImpl withWorkerCount(long workerCount) { + this.innerModel().withWorkerCount(workerCount); + return this; + } + + public HybridAksClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateHybridAksClusterUpdateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClustersClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClustersClientImpl.java new file mode 100644 index 000000000000..a3d9191d954a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClustersClientImpl.java @@ -0,0 +1,1942 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.HybridAksClustersClient; +import com.azure.resourcemanager.networkcloud.fluent.models.HybridAksClusterInner; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterList; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterPatchParameters; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterRestartNodeParameters; +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 HybridAksClustersClient. */ +public final class HybridAksClustersClientImpl implements HybridAksClustersClient { + /** The proxy service used to perform REST calls. */ + private final HybridAksClustersService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of HybridAksClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HybridAksClustersClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(HybridAksClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudHybridAksClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudHybridAk") + public interface HybridAksClustersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/hybridAksClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hybridAksClusterName") String hybridAksClusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hybridAksClusterName") String hybridAksClusterName, + @BodyParam("application/json") HybridAksClusterInner hybridAksClusterParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hybridAksClusterName") String hybridAksClusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hybridAksClusterName") String hybridAksClusterName, + @BodyParam("application/json") HybridAksClusterPatchParameters hybridAksClusterUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/hybridAksClusters/{hybridAksClusterName}/restartNode") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restartNode( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("hybridAksClusterName") String hybridAksClusterName, + @BodyParam("application/json") HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 list of additional details related to Hybrid AKS provisioned clusters in the provided subscription + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 list of additional details related to Hybrid AKS provisioned clusters in the provided subscription + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of additional details for Hybrid AKS provisioned clusters in the provided resource group along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of additional details for Hybrid AKS provisioned clusters in the provided resource group along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String hybridAksClusterName) { + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String hybridAksClusterName, 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + accept, + context); + } + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String hybridAksClusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hybridAksClusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String hybridAksClusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, hybridAksClusterName, context).block(); + } + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HybridAksClusterInner getByResourceGroup(String resourceGroupName, String hybridAksClusterName) { + return getByResourceGroupWithResponse(resourceGroupName, hybridAksClusterName, Context.NONE).getValue(); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters) { + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + if (hybridAksClusterParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter hybridAksClusterParameters is required and cannot be null.")); + } else { + hybridAksClusterParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + if (hybridAksClusterParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter hybridAksClusterParameters is required and cannot be null.")); + } else { + hybridAksClusterParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + hybridAksClusterParameters, + accept, + context); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the + * Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HybridAksClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + HybridAksClusterInner.class, + HybridAksClusterInner.class, + this.client.getContext()); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the + * Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HybridAksClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, hybridAksClusterName, hybridAksClusterParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), HybridAksClusterInner.class, HybridAksClusterInner.class, context); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the + * Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HybridAksClusterInner> beginCreateOrUpdate( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters) + .getSyncPoller(); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the + * Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HybridAksClusterInner> beginCreateOrUpdate( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HybridAksClusterInner createOrUpdate( + String resourceGroupName, String hybridAksClusterName, HybridAksClusterInner hybridAksClusterParameters) { + return createOrUpdateAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters).block(); + } + + /** + * Create or update the additional details related to the Hybrid AKS provisioned cluster. + * + *

Create new additional details related to the Hybrid AKS provisioned cluster or update the existing one. All + * customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HybridAksClusterInner createOrUpdate( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterInner hybridAksClusterParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterParameters, context) + .block(); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String hybridAksClusterName) { + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String hybridAksClusterName, 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + accept, + context); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, hybridAksClusterName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, hybridAksClusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName) { + return this.beginDeleteAsync(resourceGroupName, hybridAksClusterName).getSyncPoller(); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName, Context context) { + return this.beginDeleteAsync(resourceGroupName, hybridAksClusterName, context).getSyncPoller(); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String hybridAksClusterName) { + return beginDeleteAsync(resourceGroupName, hybridAksClusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksClusterName, Context context) { + return beginDeleteAsync(resourceGroupName, hybridAksClusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hybridAksClusterName) { + deleteAsync(resourceGroupName, hybridAksClusterName).block(); + } + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String hybridAksClusterName, Context context) { + deleteAsync(resourceGroupName, hybridAksClusterName, context).block(); + } + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterUpdateParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterPatchParameters hybridAksClusterUpdateParameters) { + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + if (hybridAksClusterUpdateParameters != null) { + hybridAksClusterUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + hybridAksClusterUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterUpdateParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterPatchParameters hybridAksClusterUpdateParameters, + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + if (hybridAksClusterUpdateParameters != null) { + hybridAksClusterUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + hybridAksClusterUpdateParameters, + accept, + context); + } + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String hybridAksClusterName) { + final HybridAksClusterPatchParameters hybridAksClusterUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterUpdateParameters The request body. + * @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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterPatchParameters hybridAksClusterUpdateParameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, hybridAksClusterName, hybridAksClusterUpdateParameters, context) + .block(); + } + + /** + * Patch the additional details related to the Hybrid AKS provisioned cluster. + * + *

Update tags associated with the additional details related to the Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 hybridAksCluster represents the additional details regarding the Hybrid AKS cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HybridAksClusterInner update(String resourceGroupName, String hybridAksClusterName) { + final HybridAksClusterPatchParameters hybridAksClusterUpdateParameters = null; + return updateWithResponse( + resourceGroupName, hybridAksClusterName, hybridAksClusterUpdateParameters, Context.NONE) + .getValue(); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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>> restartNodeWithResponseAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + if (hybridAksClusterRestartNodeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter hybridAksClusterRestartNodeParameters is required and cannot be null.")); + } else { + hybridAksClusterRestartNodeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restartNode( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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>> restartNodeWithResponseAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + 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 (hybridAksClusterName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hybridAksClusterName is required and cannot be null.")); + } + if (hybridAksClusterRestartNodeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter hybridAksClusterRestartNodeParameters is required and cannot be null.")); + } else { + hybridAksClusterRestartNodeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restartNode( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + hybridAksClusterName, + hybridAksClusterRestartNodeParameters, + accept, + context); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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> beginRestartNodeAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + Mono>> mono = + restartNodeWithResponseAsync( + resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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> beginRestartNodeAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartNodeWithResponseAsync( + resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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> beginRestartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + return this + .beginRestartNodeAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters) + .getSyncPoller(); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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> beginRestartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context) { + return this + .beginRestartNodeAsync( + resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, context) + .getSyncPoller(); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNodeAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + return beginRestartNodeAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNodeAsync( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context) { + return beginRestartNodeAsync( + resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + restartNodeAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters).block(); + } + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context) { + restartNodeAsync(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 hybridAksClusterList represents a list of Hybrid AKS clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 hybridAksClusterList represents a list of Hybrid AKS clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 hybridAksClusterList represents a list of Hybrid AKS clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 hybridAksClusterList represents a list of Hybrid AKS clusters along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClustersImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClustersImpl.java new file mode 100644 index 000000000000..8be33565b843 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/HybridAksClustersImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.HybridAksClustersClient; +import com.azure.resourcemanager.networkcloud.fluent.models.HybridAksClusterInner; +import com.azure.resourcemanager.networkcloud.models.HybridAksCluster; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterRestartNodeParameters; +import com.azure.resourcemanager.networkcloud.models.HybridAksClusters; + +public final class HybridAksClustersImpl implements HybridAksClusters { + private static final ClientLogger LOGGER = new ClientLogger(HybridAksClustersImpl.class); + + private final HybridAksClustersClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public HybridAksClustersImpl( + HybridAksClustersClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new HybridAksClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new HybridAksClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new HybridAksClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new HybridAksClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String hybridAksClusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, hybridAksClusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HybridAksClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HybridAksCluster getByResourceGroup(String resourceGroupName, String hybridAksClusterName) { + HybridAksClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, hybridAksClusterName); + if (inner != null) { + return new HybridAksClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String hybridAksClusterName) { + this.serviceClient().delete(resourceGroupName, hybridAksClusterName); + } + + public void delete(String resourceGroupName, String hybridAksClusterName, Context context) { + this.serviceClient().delete(resourceGroupName, hybridAksClusterName, context); + } + + public void restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters) { + this + .serviceClient() + .restartNode(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters); + } + + public void restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context) { + this + .serviceClient() + .restartNode(resourceGroupName, hybridAksClusterName, hybridAksClusterRestartNodeParameters, context); + } + + public HybridAksCluster getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hybridAksClusterName = Utils.getValueFromIdByName(id, "hybridAksClusters"); + if (hybridAksClusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hybridAksClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, hybridAksClusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hybridAksClusterName = Utils.getValueFromIdByName(id, "hybridAksClusters"); + if (hybridAksClusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hybridAksClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, hybridAksClusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hybridAksClusterName = Utils.getValueFromIdByName(id, "hybridAksClusters"); + if (hybridAksClusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hybridAksClusters'.", id))); + } + this.delete(resourceGroupName, hybridAksClusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String hybridAksClusterName = Utils.getValueFromIdByName(id, "hybridAksClusters"); + if (hybridAksClusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hybridAksClusters'.", id))); + } + this.delete(resourceGroupName, hybridAksClusterName, context); + } + + private HybridAksClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public HybridAksClusterImpl define(String name) { + return new HybridAksClusterImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java new file mode 100644 index 000000000000..bbc4472b60c5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworkImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.L2Network; +import com.azure.resourcemanager.networkcloud.models.L2NetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.L2NetworkPatchParameters; +import com.azure.resourcemanager.networkcloud.models.L2NetworkProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class L2NetworkImpl implements L2Network, L2Network.Definition, L2Network.Update { + private L2NetworkInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public L2NetworkDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public List hybridAksClustersAssociatedIds() { + List inner = this.innerModel().hybridAksClustersAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HybridAksPluginType hybridAksPluginType() { + return this.innerModel().hybridAksPluginType(); + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public String l2IsolationDomainId() { + return this.innerModel().l2IsolationDomainId(); + } + + public L2NetworkProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List virtualMachinesAssociatedIds() { + List inner = this.innerModel().virtualMachinesAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public L2NetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String l2NetworkName; + + private L2NetworkPatchParameters updateL2NetworkUpdateParameters; + + public L2NetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public L2Network create() { + this.innerObject = + serviceManager + .serviceClient() + .getL2Networks() + .createOrUpdate(resourceGroupName, l2NetworkName, this.innerModel(), Context.NONE); + return this; + } + + public L2Network create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL2Networks() + .createOrUpdate(resourceGroupName, l2NetworkName, this.innerModel(), context); + return this; + } + + L2NetworkImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new L2NetworkInner(); + this.serviceManager = serviceManager; + this.l2NetworkName = name; + } + + public L2NetworkImpl update() { + this.updateL2NetworkUpdateParameters = new L2NetworkPatchParameters(); + return this; + } + + public L2Network apply() { + this.innerObject = + serviceManager + .serviceClient() + .getL2Networks() + .updateWithResponse(resourceGroupName, l2NetworkName, updateL2NetworkUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public L2Network apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL2Networks() + .updateWithResponse(resourceGroupName, l2NetworkName, updateL2NetworkUpdateParameters, context) + .getValue(); + return this; + } + + L2NetworkImpl( + L2NetworkInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l2NetworkName = Utils.getValueFromIdByName(innerObject.id(), "l2Networks"); + } + + public L2Network refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getL2Networks() + .getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, Context.NONE) + .getValue(); + return this; + } + + public L2Network refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL2Networks() + .getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, context) + .getValue(); + return this; + } + + public L2NetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public L2NetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public L2NetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public L2NetworkImpl withL2IsolationDomainId(String l2IsolationDomainId) { + this.innerModel().withL2IsolationDomainId(l2IsolationDomainId); + return this; + } + + public L2NetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateL2NetworkUpdateParameters.withTags(tags); + return this; + } + } + + public L2NetworkImpl withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + this.innerModel().withHybridAksPluginType(hybridAksPluginType); + return this; + } + + public L2NetworkImpl withInterfaceName(String interfaceName) { + this.innerModel().withInterfaceName(interfaceName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java new file mode 100644 index 000000000000..09d52b79f16f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksClientImpl.java @@ -0,0 +1,1540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.L2NetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.models.L2NetworkList; +import com.azure.resourcemanager.networkcloud.models.L2NetworkPatchParameters; +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 L2NetworksClient. */ +public final class L2NetworksClientImpl implements L2NetworksClient { + /** The proxy service used to perform REST calls. */ + private final L2NetworksService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of L2NetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + L2NetworksClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(L2NetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudL2Networks to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudL2Networ") + public interface L2NetworksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l2NetworkName") String l2NetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l2NetworkName") String l2NetworkName, + @BodyParam("application/json") L2NetworkInner l2NetworkParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l2NetworkName") String l2NetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l2NetworkName") String l2NetworkName, + @BodyParam("application/json") L2NetworkPatchParameters l2NetworkUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 list of layer 2 (L2) networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 list of layer 2 (L2) networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 2 (L2) networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 2 (L2) networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l2NetworkName) { + 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l2NetworkName, 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + accept, + context); + } + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String l2NetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l2NetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l2NetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l2NetworkName, context).block(); + } + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2NetworkInner getByResourceGroup(String resourceGroupName, String l2NetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, Context.NONE).getValue(); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters) { + 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + if (l2NetworkParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2NetworkParameters is required and cannot be null.")); + } else { + l2NetworkParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + l2NetworkParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + if (l2NetworkParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter l2NetworkParameters is required and cannot be null.")); + } else { + l2NetworkParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + l2NetworkParameters, + accept, + context); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation + * domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L2NetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, l2NetworkName, l2NetworkParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L2NetworkInner.class, + L2NetworkInner.class, + this.client.getContext()); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation + * domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L2NetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, l2NetworkName, l2NetworkParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), L2NetworkInner.class, L2NetworkInner.class, context); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation + * domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L2NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, l2NetworkName, l2NetworkParameters).getSyncPoller(); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation + * domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L2NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, l2NetworkName, l2NetworkParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, l2NetworkName, l2NetworkParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, l2NetworkName, l2NetworkParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2NetworkInner createOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters) { + return createOrUpdateAsync(resourceGroupName, l2NetworkName, l2NetworkParameters).block(); + } + + /** + * Create or update the layer 2 (L2) network. + * + *

Create a new layer 2 (L2) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2NetworkInner createOrUpdate( + String resourceGroupName, String l2NetworkName, L2NetworkInner l2NetworkParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, l2NetworkName, l2NetworkParameters, context).block(); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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>> deleteWithResponseAsync(String resourceGroupName, String l2NetworkName) { + 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String l2NetworkName, 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + accept, + context); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, l2NetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, l2NetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName) { + return this.beginDeleteAsync(resourceGroupName, l2NetworkName).getSyncPoller(); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName, Context context) { + return this.beginDeleteAsync(resourceGroupName, l2NetworkName, context).getSyncPoller(); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName) { + return beginDeleteAsync(resourceGroupName, l2NetworkName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2NetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, l2NetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 delete(String resourceGroupName, String l2NetworkName) { + deleteAsync(resourceGroupName, l2NetworkName).block(); + } + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 delete(String resourceGroupName, String l2NetworkName, Context context) { + deleteAsync(resourceGroupName, l2NetworkName, context).block(); + } + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkUpdateParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String l2NetworkName, L2NetworkPatchParameters l2NetworkUpdateParameters) { + 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + if (l2NetworkUpdateParameters != null) { + l2NetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + l2NetworkUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkUpdateParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String l2NetworkName, + L2NetworkPatchParameters l2NetworkUpdateParameters, + 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 (l2NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l2NetworkName is required and cannot be null.")); + } + if (l2NetworkUpdateParameters != null) { + l2NetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l2NetworkName, + l2NetworkUpdateParameters, + accept, + context); + } + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String l2NetworkName) { + final L2NetworkPatchParameters l2NetworkUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, l2NetworkName, l2NetworkUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @param l2NetworkUpdateParameters The request body. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String l2NetworkName, + L2NetworkPatchParameters l2NetworkUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, l2NetworkName, l2NetworkUpdateParameters, context).block(); + } + + /** + * Patch the layer 2 (L2) network. + * + *

Update tags associated with the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 l2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L2NetworkInner update(String resourceGroupName, String l2NetworkName) { + final L2NetworkPatchParameters l2NetworkUpdateParameters = null; + return updateWithResponse(resourceGroupName, l2NetworkName, l2NetworkUpdateParameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l2NetworkList represents a list of L2 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java new file mode 100644 index 000000000000..4b0b34237751 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L2NetworksImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.L2NetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.azure.resourcemanager.networkcloud.models.L2Network; +import com.azure.resourcemanager.networkcloud.models.L2Networks; + +public final class L2NetworksImpl implements L2Networks { + private static final ClientLogger LOGGER = new ClientLogger(L2NetworksImpl.class); + + private final L2NetworksClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public L2NetworksImpl( + L2NetworksClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new L2NetworkImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l2NetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new L2NetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public L2Network getByResourceGroup(String resourceGroupName, String l2NetworkName) { + L2NetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, l2NetworkName); + if (inner != null) { + return new L2NetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String l2NetworkName) { + this.serviceClient().delete(resourceGroupName, l2NetworkName); + } + + public void delete(String resourceGroupName, String l2NetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, l2NetworkName, context); + } + + public L2Network getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + if (l2NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + if (l2NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l2NetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + if (l2NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); + } + this.delete(resourceGroupName, l2NetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l2NetworkName = Utils.getValueFromIdByName(id, "l2Networks"); + if (l2NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l2Networks'.", id))); + } + this.delete(resourceGroupName, l2NetworkName, context); + } + + private L2NetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public L2NetworkImpl define(String name) { + return new L2NetworkImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java new file mode 100644 index 000000000000..69bce4f97a3b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworkImpl.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import com.azure.resourcemanager.networkcloud.models.L3Network; +import com.azure.resourcemanager.networkcloud.models.L3NetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.L3NetworkPatchParameters; +import com.azure.resourcemanager.networkcloud.models.L3NetworkProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class L3NetworkImpl implements L3Network, L3Network.Definition, L3Network.Update { + private L3NetworkInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public L3NetworkDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public List hybridAksClustersAssociatedIds() { + List inner = this.innerModel().hybridAksClustersAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HybridAksIpamEnabled hybridAksIpamEnabled() { + return this.innerModel().hybridAksIpamEnabled(); + } + + public HybridAksPluginType hybridAksPluginType() { + return this.innerModel().hybridAksPluginType(); + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public IpAllocationType ipAllocationType() { + return this.innerModel().ipAllocationType(); + } + + public String ipv4ConnectedPrefix() { + return this.innerModel().ipv4ConnectedPrefix(); + } + + public String ipv6ConnectedPrefix() { + return this.innerModel().ipv6ConnectedPrefix(); + } + + public String l3IsolationDomainId() { + return this.innerModel().l3IsolationDomainId(); + } + + public L3NetworkProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List virtualMachinesAssociatedIds() { + List inner = this.innerModel().virtualMachinesAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public long vlan() { + return this.innerModel().vlan(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public L3NetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String l3NetworkName; + + private L3NetworkPatchParameters updateL3NetworkUpdateParameters; + + public L3NetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public L3Network create() { + this.innerObject = + serviceManager + .serviceClient() + .getL3Networks() + .createOrUpdate(resourceGroupName, l3NetworkName, this.innerModel(), Context.NONE); + return this; + } + + public L3Network create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL3Networks() + .createOrUpdate(resourceGroupName, l3NetworkName, this.innerModel(), context); + return this; + } + + L3NetworkImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new L3NetworkInner(); + this.serviceManager = serviceManager; + this.l3NetworkName = name; + } + + public L3NetworkImpl update() { + this.updateL3NetworkUpdateParameters = new L3NetworkPatchParameters(); + return this; + } + + public L3Network apply() { + this.innerObject = + serviceManager + .serviceClient() + .getL3Networks() + .updateWithResponse(resourceGroupName, l3NetworkName, updateL3NetworkUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public L3Network apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL3Networks() + .updateWithResponse(resourceGroupName, l3NetworkName, updateL3NetworkUpdateParameters, context) + .getValue(); + return this; + } + + L3NetworkImpl( + L3NetworkInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.l3NetworkName = Utils.getValueFromIdByName(innerObject.id(), "l3Networks"); + } + + public L3Network refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getL3Networks() + .getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, Context.NONE) + .getValue(); + return this; + } + + public L3Network refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getL3Networks() + .getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, context) + .getValue(); + return this; + } + + public L3NetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public L3NetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public L3NetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public L3NetworkImpl withL3IsolationDomainId(String l3IsolationDomainId) { + this.innerModel().withL3IsolationDomainId(l3IsolationDomainId); + return this; + } + + public L3NetworkImpl withVlan(long vlan) { + this.innerModel().withVlan(vlan); + return this; + } + + public L3NetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateL3NetworkUpdateParameters.withTags(tags); + return this; + } + } + + public L3NetworkImpl withHybridAksIpamEnabled(HybridAksIpamEnabled hybridAksIpamEnabled) { + this.innerModel().withHybridAksIpamEnabled(hybridAksIpamEnabled); + return this; + } + + public L3NetworkImpl withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + this.innerModel().withHybridAksPluginType(hybridAksPluginType); + return this; + } + + public L3NetworkImpl withInterfaceName(String interfaceName) { + this.innerModel().withInterfaceName(interfaceName); + return this; + } + + public L3NetworkImpl withIpAllocationType(IpAllocationType ipAllocationType) { + this.innerModel().withIpAllocationType(ipAllocationType); + return this; + } + + public L3NetworkImpl withIpv4ConnectedPrefix(String ipv4ConnectedPrefix) { + this.innerModel().withIpv4ConnectedPrefix(ipv4ConnectedPrefix); + return this; + } + + public L3NetworkImpl withIpv6ConnectedPrefix(String ipv6ConnectedPrefix) { + this.innerModel().withIpv6ConnectedPrefix(ipv6ConnectedPrefix); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java new file mode 100644 index 000000000000..69e676b70e4e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksClientImpl.java @@ -0,0 +1,1540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.L3NetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.models.L3NetworkList; +import com.azure.resourcemanager.networkcloud.models.L3NetworkPatchParameters; +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 L3NetworksClient. */ +public final class L3NetworksClientImpl implements L3NetworksClient { + /** The proxy service used to perform REST calls. */ + private final L3NetworksService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of L3NetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + L3NetworksClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(L3NetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudL3Networks to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudL3Networ") + public interface L3NetworksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l3NetworkName") String l3NetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l3NetworkName") String l3NetworkName, + @BodyParam("application/json") L3NetworkInner l3NetworkParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l3NetworkName") String l3NetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("l3NetworkName") String l3NetworkName, + @BodyParam("application/json") L3NetworkPatchParameters l3NetworkUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 list of layer 3 (L3) networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 list of layer 3 (L3) networks in the provided subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 3 (L3) networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 3 (L3) networks in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l3NetworkName) { + 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String l3NetworkName, 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + accept, + context); + } + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String l3NetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l3NetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l3NetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, l3NetworkName, context).block(); + } + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3NetworkInner getByResourceGroup(String resourceGroupName, String l3NetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, Context.NONE).getValue(); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters) { + 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + if (l3NetworkParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3NetworkParameters is required and cannot be null.")); + } else { + l3NetworkParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + l3NetworkParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + if (l3NetworkParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter l3NetworkParameters is required and cannot be null.")); + } else { + l3NetworkParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + l3NetworkParameters, + accept, + context); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation + * domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L3NetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, l3NetworkName, l3NetworkParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + L3NetworkInner.class, + L3NetworkInner.class, + this.client.getContext()); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation + * domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, L3NetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, l3NetworkName, l3NetworkParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), L3NetworkInner.class, L3NetworkInner.class, context); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation + * domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L3NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, l3NetworkName, l3NetworkParameters).getSyncPoller(); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation + * domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, L3NetworkInner> beginCreateOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, l3NetworkName, l3NetworkParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, l3NetworkName, l3NetworkParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, l3NetworkName, l3NetworkParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3NetworkInner createOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters) { + return createOrUpdateAsync(resourceGroupName, l3NetworkName, l3NetworkParameters).block(); + } + + /** + * Create or update the layer 3 (L3) network. + * + *

Create a new layer 3 (L3) network or update the properties of the existing network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3NetworkInner createOrUpdate( + String resourceGroupName, String l3NetworkName, L3NetworkInner l3NetworkParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, l3NetworkName, l3NetworkParameters, context).block(); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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>> deleteWithResponseAsync(String resourceGroupName, String l3NetworkName) { + 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String l3NetworkName, 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + accept, + context); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, l3NetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, l3NetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName) { + return this.beginDeleteAsync(resourceGroupName, l3NetworkName).getSyncPoller(); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName, Context context) { + return this.beginDeleteAsync(resourceGroupName, l3NetworkName, context).getSyncPoller(); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName) { + return beginDeleteAsync(resourceGroupName, l3NetworkName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3NetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, l3NetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 delete(String resourceGroupName, String l3NetworkName) { + deleteAsync(resourceGroupName, l3NetworkName).block(); + } + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 delete(String resourceGroupName, String l3NetworkName, Context context) { + deleteAsync(resourceGroupName, l3NetworkName, context).block(); + } + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkUpdateParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String l3NetworkName, L3NetworkPatchParameters l3NetworkUpdateParameters) { + 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + if (l3NetworkUpdateParameters != null) { + l3NetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + l3NetworkUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkUpdateParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String l3NetworkName, + L3NetworkPatchParameters l3NetworkUpdateParameters, + 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 (l3NetworkName == null) { + return Mono.error(new IllegalArgumentException("Parameter l3NetworkName is required and cannot be null.")); + } + if (l3NetworkUpdateParameters != null) { + l3NetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + l3NetworkName, + l3NetworkUpdateParameters, + accept, + context); + } + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String l3NetworkName) { + final L3NetworkPatchParameters l3NetworkUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, l3NetworkName, l3NetworkUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @param l3NetworkUpdateParameters The request body. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String l3NetworkName, + L3NetworkPatchParameters l3NetworkUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, l3NetworkName, l3NetworkUpdateParameters, context).block(); + } + + /** + * Patch the layer 3 (L3) network. + * + *

Update tags associated with the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 l3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public L3NetworkInner update(String resourceGroupName, String l3NetworkName) { + final L3NetworkPatchParameters l3NetworkUpdateParameters = null; + return updateWithResponse(resourceGroupName, l3NetworkName, l3NetworkUpdateParameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 l3NetworkList represents a list of L3 networks along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java new file mode 100644 index 000000000000..a544ba8bfadc --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/L3NetworksImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.L3NetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.azure.resourcemanager.networkcloud.models.L3Network; +import com.azure.resourcemanager.networkcloud.models.L3Networks; + +public final class L3NetworksImpl implements L3Networks { + private static final ClientLogger LOGGER = new ClientLogger(L3NetworksImpl.class); + + private final L3NetworksClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public L3NetworksImpl( + L3NetworksClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new L3NetworkImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String l3NetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new L3NetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public L3Network getByResourceGroup(String resourceGroupName, String l3NetworkName) { + L3NetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, l3NetworkName); + if (inner != null) { + return new L3NetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String l3NetworkName) { + this.serviceClient().delete(resourceGroupName, l3NetworkName); + } + + public void delete(String resourceGroupName, String l3NetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, l3NetworkName, context); + } + + public L3Network getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + if (l3NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + if (l3NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, l3NetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + if (l3NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); + } + this.delete(resourceGroupName, l3NetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String l3NetworkName = Utils.getValueFromIdByName(id, "l3Networks"); + if (l3NetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'l3Networks'.", id))); + } + this.delete(resourceGroupName, l3NetworkName, context); + } + + private L3NetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public L3NetworkImpl define(String name) { + return new L3NetworkImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java new file mode 100644 index 000000000000..f53725657317 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsClientImpl.java @@ -0,0 +1,1696 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.MetricsConfigurationsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationList; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfigurationPatchParameters; +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 MetricsConfigurationsClient. */ +public final class MetricsConfigurationsClientImpl implements MetricsConfigurationsClient { + /** The proxy service used to perform REST calls. */ + private final MetricsConfigurationsService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of MetricsConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MetricsConfigurationsClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy + .create(MetricsConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudMetricsConfigurations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudMetricsC") + public interface MetricsConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("metricsConfigurationName") String metricsConfigurationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("metricsConfigurationName") String metricsConfigurationName, + @BodyParam("application/json") ClusterMetricsConfigurationInner metricsConfigurationParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("metricsConfigurationName") String metricsConfigurationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("metricsConfigurationName") String metricsConfigurationName, + @BodyParam("application/json") + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 list of metrics configurations of the clusters in the provided resource group along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + 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 + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, clusterName)); + } + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, clusterName, context)); + } + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName, 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + accept, + context); + } + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + return getWithResponseAsync(resourceGroupName, clusterName, metricsConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, metricsConfigurationName, context).block(); + } + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterMetricsConfigurationInner get( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + return getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, Context.NONE).getValue(); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters) { + 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + if (metricsConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter metricsConfigurationParameters is required and cannot be null.")); + } else { + metricsConfigurationParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + if (metricsConfigurationParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter metricsConfigurationParameters is required and cannot be null.")); + } else { + metricsConfigurationParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationParameters, + accept, + context); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterMetricsConfigurationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterMetricsConfigurationInner.class, + ClusterMetricsConfigurationInner.class, + this.client.getContext()); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterMetricsConfigurationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterMetricsConfigurationInner.class, + ClusterMetricsConfigurationInner.class, + context); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterMetricsConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters) + .getSyncPoller(); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterMetricsConfigurationInner> + beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters, context) + .getSyncPoller(); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterMetricsConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters) { + return createOrUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters) + .block(); + } + + /** + * Update the metrics configuration of the cluster. + * + *

Update the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterMetricsConfigurationInner createOrUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationInner metricsConfigurationParameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationParameters, context) + .block(); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName, 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + accept, + context); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, metricsConfigurationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, metricsConfigurationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName).getSyncPoller(); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context).getSyncPoller(); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String metricsConfigurationName) { + return beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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, String metricsConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName) { + deleteAsync(resourceGroupName, clusterName, metricsConfigurationName).block(); + } + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { + deleteAsync(resourceGroupName, clusterName, metricsConfigurationName, context).block(); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters) { + 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + if (metricsConfigurationUpdateParameters != null) { + metricsConfigurationUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + 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 (metricsConfigurationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter metricsConfigurationName is required and cannot be null.")); + } + if (metricsConfigurationUpdateParameters != null) { + metricsConfigurationUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationUpdateParameters, + accept, + context); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterMetricsConfigurationInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterMetricsConfigurationInner.class, + ClusterMetricsConfigurationInner.class, + this.client.getContext()); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterMetricsConfigurationInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + final ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterMetricsConfigurationInner.class, + ClusterMetricsConfigurationInner.class, + this.client.getContext()); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterMetricsConfigurationInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + clusterName, + metricsConfigurationName, + metricsConfigurationUpdateParameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterMetricsConfigurationInner.class, + ClusterMetricsConfigurationInner.class, + context); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterMetricsConfigurationInner> beginUpdate( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + final ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters = null; + return this + .beginUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of + * an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterMetricsConfigurationInner> beginUpdate( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + final ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters = null; + return beginUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterMetricsConfigurationInner update( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + final ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters = null; + return updateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters) + .block(); + } + + /** + * Patch metrics configuration of the cluster. + * + *

Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for the cluster. + * @param metricsConfigurationUpdateParameters The request body. + * @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 clusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterMetricsConfigurationInner update( + String resourceGroupName, + String clusterName, + String metricsConfigurationName, + ClusterMetricsConfigurationPatchParameters metricsConfigurationUpdateParameters, + Context context) { + return updateAsync( + resourceGroupName, clusterName, metricsConfigurationName, metricsConfigurationUpdateParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterMetricsConfigurationList represents a list of metrics configuration of the cluster along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 clusterMetricsConfigurationList represents a list of metrics configuration of the cluster along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java new file mode 100644 index 000000000000..f70fd0afd120 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/MetricsConfigurationsImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.MetricsConfigurationsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; +import com.azure.resourcemanager.networkcloud.models.MetricsConfigurations; + +public final class MetricsConfigurationsImpl implements MetricsConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(MetricsConfigurationsImpl.class); + + private final MetricsConfigurationsClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public MetricsConfigurationsImpl( + MetricsConfigurationsClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new ClusterMetricsConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ClusterMetricsConfigurationImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterMetricsConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterMetricsConfiguration get( + String resourceGroupName, String clusterName, String metricsConfigurationName) { + ClusterMetricsConfigurationInner inner = + this.serviceClient().get(resourceGroupName, clusterName, metricsConfigurationName); + if (inner != null) { + return new ClusterMetricsConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName) { + this.serviceClient().delete(resourceGroupName, clusterName, metricsConfigurationName); + } + + public void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, metricsConfigurationName, context); + } + + public ClusterMetricsConfiguration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + if (metricsConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + if (metricsConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, metricsConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + if (metricsConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", + id))); + } + this.delete(resourceGroupName, clusterName, metricsConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String metricsConfigurationName = Utils.getValueFromIdByName(id, "metricsConfigurations"); + if (metricsConfigurationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'metricsConfigurations'.", + id))); + } + this.delete(resourceGroupName, clusterName, metricsConfigurationName, context); + } + + private MetricsConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public ClusterMetricsConfigurationImpl define(String name) { + return new ClusterMetricsConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java new file mode 100644 index 000000000000..7864ce852d2e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the NetworkCloudImpl type. */ +@ServiceClientBuilder(serviceClients = {NetworkCloudImpl.class}) +public final class NetworkCloudBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the NetworkCloudBuilder. + */ + public NetworkCloudBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the NetworkCloudBuilder. + */ + public NetworkCloudBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the NetworkCloudBuilder. + */ + public NetworkCloudBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the NetworkCloudBuilder. + */ + public NetworkCloudBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the NetworkCloudBuilder. + */ + public NetworkCloudBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the NetworkCloudBuilder. + */ + public NetworkCloudBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of NetworkCloudImpl with the provided parameters. + * + * @return an instance of NetworkCloudImpl. + */ + public NetworkCloudImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + NetworkCloudImpl client = + new NetworkCloudImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java new file mode 100644 index 000000000000..8225c1c09d93 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/NetworkCloudImpl.java @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.networkcloud.fluent.BareMetalMachineKeySetsClient; +import com.azure.resourcemanager.networkcloud.fluent.BareMetalMachinesClient; +import com.azure.resourcemanager.networkcloud.fluent.BmcKeySetsClient; +import com.azure.resourcemanager.networkcloud.fluent.CloudServicesNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.ClusterManagersClient; +import com.azure.resourcemanager.networkcloud.fluent.ClustersClient; +import com.azure.resourcemanager.networkcloud.fluent.ConsolesClient; +import com.azure.resourcemanager.networkcloud.fluent.DefaultCniNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.HybridAksClustersClient; +import com.azure.resourcemanager.networkcloud.fluent.L2NetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.L3NetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.MetricsConfigurationsClient; +import com.azure.resourcemanager.networkcloud.fluent.NetworkCloud; +import com.azure.resourcemanager.networkcloud.fluent.OperationsClient; +import com.azure.resourcemanager.networkcloud.fluent.RackSkusClient; +import com.azure.resourcemanager.networkcloud.fluent.RacksClient; +import com.azure.resourcemanager.networkcloud.fluent.StorageAppliancesClient; +import com.azure.resourcemanager.networkcloud.fluent.TrunkedNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.networkcloud.fluent.VolumesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the NetworkCloudImpl type. */ +@ServiceClient(builder = NetworkCloudBuilder.class) +public final class NetworkCloudImpl implements NetworkCloud { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The BareMetalMachinesClient object to access its operations. */ + private final BareMetalMachinesClient bareMetalMachines; + + /** + * Gets the BareMetalMachinesClient object to access its operations. + * + * @return the BareMetalMachinesClient object. + */ + public BareMetalMachinesClient getBareMetalMachines() { + return this.bareMetalMachines; + } + + /** The CloudServicesNetworksClient object to access its operations. */ + private final CloudServicesNetworksClient cloudServicesNetworks; + + /** + * Gets the CloudServicesNetworksClient object to access its operations. + * + * @return the CloudServicesNetworksClient object. + */ + public CloudServicesNetworksClient getCloudServicesNetworks() { + return this.cloudServicesNetworks; + } + + /** The ClusterManagersClient object to access its operations. */ + private final ClusterManagersClient clusterManagers; + + /** + * Gets the ClusterManagersClient object to access its operations. + * + * @return the ClusterManagersClient object. + */ + public ClusterManagersClient getClusterManagers() { + return this.clusterManagers; + } + + /** The ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** The DefaultCniNetworksClient object to access its operations. */ + private final DefaultCniNetworksClient defaultCniNetworks; + + /** + * Gets the DefaultCniNetworksClient object to access its operations. + * + * @return the DefaultCniNetworksClient object. + */ + public DefaultCniNetworksClient getDefaultCniNetworks() { + return this.defaultCniNetworks; + } + + /** The HybridAksClustersClient object to access its operations. */ + private final HybridAksClustersClient hybridAksClusters; + + /** + * Gets the HybridAksClustersClient object to access its operations. + * + * @return the HybridAksClustersClient object. + */ + public HybridAksClustersClient getHybridAksClusters() { + return this.hybridAksClusters; + } + + /** The L2NetworksClient object to access its operations. */ + private final L2NetworksClient l2Networks; + + /** + * Gets the L2NetworksClient object to access its operations. + * + * @return the L2NetworksClient object. + */ + public L2NetworksClient getL2Networks() { + return this.l2Networks; + } + + /** The L3NetworksClient object to access its operations. */ + private final L3NetworksClient l3Networks; + + /** + * Gets the L3NetworksClient object to access its operations. + * + * @return the L3NetworksClient object. + */ + public L3NetworksClient getL3Networks() { + return this.l3Networks; + } + + /** The RackSkusClient object to access its operations. */ + private final RackSkusClient rackSkus; + + /** + * Gets the RackSkusClient object to access its operations. + * + * @return the RackSkusClient object. + */ + public RackSkusClient getRackSkus() { + return this.rackSkus; + } + + /** The RacksClient object to access its operations. */ + private final RacksClient racks; + + /** + * Gets the RacksClient object to access its operations. + * + * @return the RacksClient object. + */ + public RacksClient getRacks() { + return this.racks; + } + + /** The StorageAppliancesClient object to access its operations. */ + private final StorageAppliancesClient storageAppliances; + + /** + * Gets the StorageAppliancesClient object to access its operations. + * + * @return the StorageAppliancesClient object. + */ + public StorageAppliancesClient getStorageAppliances() { + return this.storageAppliances; + } + + /** The TrunkedNetworksClient object to access its operations. */ + private final TrunkedNetworksClient trunkedNetworks; + + /** + * Gets the TrunkedNetworksClient object to access its operations. + * + * @return the TrunkedNetworksClient object. + */ + public TrunkedNetworksClient getTrunkedNetworks() { + return this.trunkedNetworks; + } + + /** The VirtualMachinesClient object to access its operations. */ + private final VirtualMachinesClient virtualMachines; + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + public VirtualMachinesClient getVirtualMachines() { + return this.virtualMachines; + } + + /** The VolumesClient object to access its operations. */ + private final VolumesClient volumes; + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + public VolumesClient getVolumes() { + return this.volumes; + } + + /** The BareMetalMachineKeySetsClient object to access its operations. */ + private final BareMetalMachineKeySetsClient bareMetalMachineKeySets; + + /** + * Gets the BareMetalMachineKeySetsClient object to access its operations. + * + * @return the BareMetalMachineKeySetsClient object. + */ + public BareMetalMachineKeySetsClient getBareMetalMachineKeySets() { + return this.bareMetalMachineKeySets; + } + + /** The BmcKeySetsClient object to access its operations. */ + private final BmcKeySetsClient bmcKeySets; + + /** + * Gets the BmcKeySetsClient object to access its operations. + * + * @return the BmcKeySetsClient object. + */ + public BmcKeySetsClient getBmcKeySets() { + return this.bmcKeySets; + } + + /** The MetricsConfigurationsClient object to access its operations. */ + private final MetricsConfigurationsClient metricsConfigurations; + + /** + * Gets the MetricsConfigurationsClient object to access its operations. + * + * @return the MetricsConfigurationsClient object. + */ + public MetricsConfigurationsClient getMetricsConfigurations() { + return this.metricsConfigurations; + } + + /** The ConsolesClient object to access its operations. */ + private final ConsolesClient consoles; + + /** + * Gets the ConsolesClient object to access its operations. + * + * @return the ConsolesClient object. + */ + public ConsolesClient getConsoles() { + return this.consoles; + } + + /** + * Initializes an instance of NetworkCloud client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + NetworkCloudImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-12-12-preview"; + this.operations = new OperationsClientImpl(this); + this.bareMetalMachines = new BareMetalMachinesClientImpl(this); + this.cloudServicesNetworks = new CloudServicesNetworksClientImpl(this); + this.clusterManagers = new ClusterManagersClientImpl(this); + this.clusters = new ClustersClientImpl(this); + this.defaultCniNetworks = new DefaultCniNetworksClientImpl(this); + this.hybridAksClusters = new HybridAksClustersClientImpl(this); + this.l2Networks = new L2NetworksClientImpl(this); + this.l3Networks = new L3NetworksClientImpl(this); + this.rackSkus = new RackSkusClientImpl(this); + this.racks = new RacksClientImpl(this); + this.storageAppliances = new StorageAppliancesClientImpl(this); + this.trunkedNetworks = new TrunkedNetworksClientImpl(this); + this.virtualMachines = new VirtualMachinesClientImpl(this); + this.volumes = new VolumesClientImpl(this); + this.bareMetalMachineKeySets = new BareMetalMachineKeySetsClientImpl(this); + this.bmcKeySets = new BmcKeySetsClientImpl(this); + this.metricsConfigurations = new MetricsConfigurationsClientImpl(this); + this.consoles = new ConsolesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkCloudImpl.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationImpl.java new file mode 100644 index 000000000000..d1ee58c0cdc2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; +import com.azure.resourcemanager.networkcloud.models.ActionType; +import com.azure.resourcemanager.networkcloud.models.Operation; +import com.azure.resourcemanager.networkcloud.models.OperationDisplay; +import com.azure.resourcemanager.networkcloud.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..f8e4ca6ff08f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsClientImpl.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.networkcloud.fluent.OperationsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; +import com.azure.resourcemanager.networkcloud.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudOperatio") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.NetworkCloud/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 list of all available resource provider operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 list of all available resource provider operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 list of all available resource provider operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 list of all available resource provider operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 list of all available resource provider operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 list of all available resource provider operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.java new file mode 100644 index 000000000000..d82e31e97afe --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/OperationsImpl.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.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.OperationsClient; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; +import com.azure.resourcemanager.networkcloud.models.Operation; +import com.azure.resourcemanager.networkcloud.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java new file mode 100644 index 000000000000..e261a836124e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.Rack; +import com.azure.resourcemanager.networkcloud.models.RackDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.RackPatchParameters; +import com.azure.resourcemanager.networkcloud.models.RackProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class RackImpl implements Rack, Rack.Definition, Rack.Update { + private RackInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String availabilityZone() { + return this.innerModel().availabilityZone(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public RackDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public RackProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String rackLocation() { + return this.innerModel().rackLocation(); + } + + public String rackSerialNumber() { + return this.innerModel().rackSerialNumber(); + } + + public String rackSkuId() { + return this.innerModel().rackSkuId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RackInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String rackName; + + private RackPatchParameters updateRackUpdateParameters; + + public RackImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Rack create() { + this.innerObject = + serviceManager + .serviceClient() + .getRacks() + .createOrUpdate(resourceGroupName, rackName, this.innerModel(), Context.NONE); + return this; + } + + public Rack create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRacks() + .createOrUpdate(resourceGroupName, rackName, this.innerModel(), context); + return this; + } + + RackImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new RackInner(); + this.serviceManager = serviceManager; + this.rackName = name; + } + + public RackImpl update() { + this.updateRackUpdateParameters = new RackPatchParameters(); + return this; + } + + public Rack apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRacks() + .update(resourceGroupName, rackName, updateRackUpdateParameters, Context.NONE); + return this; + } + + public Rack apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRacks() + .update(resourceGroupName, rackName, updateRackUpdateParameters, context); + return this; + } + + RackImpl(RackInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.rackName = Utils.getValueFromIdByName(innerObject.id(), "racks"); + } + + public Rack refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRacks() + .getByResourceGroupWithResponse(resourceGroupName, rackName, Context.NONE) + .getValue(); + return this; + } + + public Rack refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRacks() + .getByResourceGroupWithResponse(resourceGroupName, rackName, context) + .getValue(); + return this; + } + + public RackImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RackImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RackImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public RackImpl withAvailabilityZone(String availabilityZone) { + this.innerModel().withAvailabilityZone(availabilityZone); + return this; + } + + public RackImpl withRackLocation(String rackLocation) { + if (isInCreateMode()) { + this.innerModel().withRackLocation(rackLocation); + return this; + } else { + this.updateRackUpdateParameters.withRackLocation(rackLocation); + return this; + } + } + + public RackImpl withRackSerialNumber(String rackSerialNumber) { + if (isInCreateMode()) { + this.innerModel().withRackSerialNumber(rackSerialNumber); + return this; + } else { + this.updateRackUpdateParameters.withRackSerialNumber(rackSerialNumber); + return this; + } + } + + public RackImpl withRackSkuId(String rackSkuId) { + this.innerModel().withRackSkuId(rackSkuId); + return this; + } + + public RackImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRackUpdateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkuImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkuImpl.java new file mode 100644 index 000000000000..2afa12520b9b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkuImpl.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; +import com.azure.resourcemanager.networkcloud.models.MachineSkuSlot; +import com.azure.resourcemanager.networkcloud.models.RackSku; +import com.azure.resourcemanager.networkcloud.models.RackSkuProvisioningState; +import com.azure.resourcemanager.networkcloud.models.RackSkuType; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceSkuSlot; +import java.util.Collections; +import java.util.List; + +public final class RackSkuImpl implements RackSku { + private RackSkuInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + RackSkuImpl(RackSkuInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List computeMachines() { + List inner = this.innerModel().computeMachines(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List controllerMachines() { + List inner = this.innerModel().controllerMachines(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String description() { + return this.innerModel().description(); + } + + public Long maxClusterSlots() { + return this.innerModel().maxClusterSlots(); + } + + public RackSkuProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RackSkuType rackType() { + return this.innerModel().rackType(); + } + + public List storageAppliances() { + List inner = this.innerModel().storageAppliances(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List supportedRackSkuIds() { + List inner = this.innerModel().supportedRackSkuIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RackSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java new file mode 100644 index 000000000000..98acd577f340 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusClientImpl.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.networkcloud.fluent.RackSkusClient; +import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; +import com.azure.resourcemanager.networkcloud.models.RackSkuList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RackSkusClient. */ +public final class RackSkusClientImpl implements RackSkusClient { + /** The proxy service used to perform REST calls. */ + private final RackSkusService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of RackSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RackSkusClientImpl(NetworkCloudImpl client) { + this.service = RestProxy.create(RackSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudRackSkus to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudRackSkus") + public interface RackSkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("rackSkuName") String rackSkuName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 list of rack SKUs in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 list of rack SKUs in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 list of rack SKUs in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 list of rack SKUs in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String rackSkuName) { + 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 (rackSkuName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackSkuName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + rackSkuName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String rackSkuName, 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 (rackSkuName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackSkuName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + rackSkuName, + accept, + context); + } + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String rackSkuName) { + return getWithResponseAsync(rackSkuName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String rackSkuName, Context context) { + return getWithResponseAsync(rackSkuName, context).block(); + } + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RackSkuInner get(String rackSkuName) { + return getWithResponse(rackSkuName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 rackSkuList represents a list of rack SKUs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 rackSkuList represents a list of rack SKUs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java new file mode 100644 index 000000000000..7b2c65d50265 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RackSkusImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.RackSkusClient; +import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; +import com.azure.resourcemanager.networkcloud.models.RackSku; +import com.azure.resourcemanager.networkcloud.models.RackSkus; + +public final class RackSkusImpl implements RackSkus { + private static final ClientLogger LOGGER = new ClientLogger(RackSkusImpl.class); + + private final RackSkusClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public RackSkusImpl( + RackSkusClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RackSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RackSkuImpl(inner1, this.manager())); + } + + public Response getWithResponse(String rackSkuName, Context context) { + Response inner = this.serviceClient().getWithResponse(rackSkuName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RackSkuImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RackSku get(String rackSkuName) { + RackSkuInner inner = this.serviceClient().get(rackSkuName); + if (inner != null) { + return new RackSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + private RackSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java new file mode 100644 index 000000000000..ae0b242a8be7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksClientImpl.java @@ -0,0 +1,1702 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.RacksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; +import com.azure.resourcemanager.networkcloud.models.RackList; +import com.azure.resourcemanager.networkcloud.models.RackPatchParameters; +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 RacksClient. */ +public final class RacksClientImpl implements RacksClient { + /** The proxy service used to perform REST calls. */ + private final RacksService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of RacksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RacksClientImpl(NetworkCloudImpl client) { + this.service = RestProxy.create(RacksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudRacks to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudRacks") + public interface RacksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("rackName") String rackName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("rackName") String rackName, + @BodyParam("application/json") RackInner rackParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("rackName") String rackName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("rackName") String rackName, + @BodyParam("application/json") RackPatchParameters rackUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 list of racks in the provided subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 list of racks in the provided subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 list of racks in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 list of racks in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 list of racks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 list of racks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of racks in the provided resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of racks in the provided resource group along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of racks in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of racks in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of racks in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of racks in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String rackName) { + 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String rackName, 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + accept, + context); + } + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String rackName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, rackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String rackName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, rackName, context).block(); + } + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RackInner getByResourceGroup(String resourceGroupName, String rackName) { + return getByResourceGroupWithResponse(resourceGroupName, rackName, Context.NONE).getValue(); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String rackName, RackInner rackParameters) { + 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + if (rackParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter rackParameters is required and cannot be null.")); + } else { + rackParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + rackParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String rackName, RackInner rackParameters, 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + if (rackParameters == null) { + return Mono.error(new IllegalArgumentException("Parameter rackParameters is required and cannot be null.")); + } else { + rackParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + rackParameters, + accept, + context); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RackInner> beginCreateOrUpdateAsync( + String resourceGroupName, String rackName, RackInner rackParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, rackName, rackParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RackInner.class, RackInner.class, this.client.getContext()); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RackInner> beginCreateOrUpdateAsync( + String resourceGroupName, String rackName, RackInner rackParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, rackName, rackParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RackInner.class, RackInner.class, context); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RackInner> beginCreateOrUpdate( + String resourceGroupName, String rackName, RackInner rackParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, rackName, rackParameters).getSyncPoller(); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RackInner> beginCreateOrUpdate( + String resourceGroupName, String rackName, RackInner rackParameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, rackName, rackParameters, context).getSyncPoller(); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String rackName, RackInner rackParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, rackName, rackParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String rackName, RackInner rackParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, rackName, rackParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RackInner createOrUpdate(String resourceGroupName, String rackName, RackInner rackParameters) { + return createOrUpdateAsync(resourceGroupName, rackName, rackParameters).block(); + } + + /** + * Create or update the rack. + * + *

Create a new rack or update properties of the existing one. All customer initiated requests will be rejected + * as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RackInner createOrUpdate( + String resourceGroupName, String rackName, RackInner rackParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, rackName, rackParameters, context).block(); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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>> deleteWithResponseAsync(String resourceGroupName, String rackName) { + 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String rackName, 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + accept, + context); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, rackName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, rackName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName) { + return this.beginDeleteAsync(resourceGroupName, rackName).getSyncPoller(); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName, Context context) { + return this.beginDeleteAsync(resourceGroupName, rackName, context).getSyncPoller(); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName) { + return beginDeleteAsync(resourceGroupName, rackName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rackName, Context context) { + return beginDeleteAsync(resourceGroupName, rackName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 delete(String resourceGroupName, String rackName) { + deleteAsync(resourceGroupName, rackName).block(); + } + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 delete(String resourceGroupName, String rackName, Context context) { + deleteAsync(resourceGroupName, rackName, context).block(); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters) { + 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + if (rackUpdateParameters != null) { + rackUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + rackUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, 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 (rackName == null) { + return Mono.error(new IllegalArgumentException("Parameter rackName is required and cannot be null.")); + } + if (rackUpdateParameters != null) { + rackUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + rackName, + rackUpdateParameters, + accept, + context); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RackInner> beginUpdateAsync( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, rackName, rackUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RackInner.class, RackInner.class, this.client.getContext()); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RackInner> beginUpdateAsync(String resourceGroupName, String rackName) { + final RackPatchParameters rackUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, rackName, rackUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RackInner.class, RackInner.class, this.client.getContext()); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RackInner> beginUpdateAsync( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, rackName, rackUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RackInner.class, RackInner.class, context); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RackInner> beginUpdate(String resourceGroupName, String rackName) { + final RackPatchParameters rackUpdateParameters = null; + return this.beginUpdateAsync(resourceGroupName, rackName, rackUpdateParameters).getSyncPoller(); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the + * cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RackInner> beginUpdate( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, rackName, rackUpdateParameters, context).getSyncPoller(); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters) { + return beginUpdateAsync(resourceGroupName, rackName, rackUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String rackName) { + final RackPatchParameters rackUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, rackName, rackUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context) { + return beginUpdateAsync(resourceGroupName, rackName, rackUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RackInner update(String resourceGroupName, String rackName) { + final RackPatchParameters rackUpdateParameters = null; + return updateAsync(resourceGroupName, rackName, rackUpdateParameters).block(); + } + + /** + * Patch the rack. + * + *

Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates + * can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @param rackUpdateParameters The request body. + * @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 rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RackInner update( + String resourceGroupName, String rackName, RackPatchParameters rackUpdateParameters, Context context) { + return updateAsync(resourceGroupName, rackName, rackUpdateParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 rackList represents a list of racks along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java new file mode 100644 index 000000000000..3855694216b3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/RacksImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.RacksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; +import com.azure.resourcemanager.networkcloud.models.Rack; +import com.azure.resourcemanager.networkcloud.models.Racks; + +public final class RacksImpl implements Racks { + private static final ClientLogger LOGGER = new ClientLogger(RacksImpl.class); + + private final RacksClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public RacksImpl( + RacksClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RackImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String rackName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, rackName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RackImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Rack getByResourceGroup(String resourceGroupName, String rackName) { + RackInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, rackName); + if (inner != null) { + return new RackImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String rackName) { + this.serviceClient().delete(resourceGroupName, rackName); + } + + public void delete(String resourceGroupName, String rackName, Context context) { + this.serviceClient().delete(resourceGroupName, rackName, context); + } + + public Rack getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String rackName = Utils.getValueFromIdByName(id, "racks"); + if (rackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, rackName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String rackName = Utils.getValueFromIdByName(id, "racks"); + if (rackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, rackName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String rackName = Utils.getValueFromIdByName(id, "racks"); + if (rackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); + } + this.delete(resourceGroupName, rackName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String rackName = Utils.getValueFromIdByName(id, "racks"); + if (rackName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'racks'.", id))); + } + this.delete(resourceGroupName, rackName, context); + } + + private RacksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public RackImpl define(String name) { + return new RackImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java new file mode 100644 index 000000000000..795aeaaded24 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageApplianceImpl.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner; +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementFeature; +import com.azure.resourcemanager.networkcloud.models.RemoteVendorManagementStatus; +import com.azure.resourcemanager.networkcloud.models.StorageAppliance; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; +import com.azure.resourcemanager.networkcloud.models.StorageAppliancePatchParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceProvisioningState; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceValidateHardwareParameters; +import java.util.Collections; +import java.util.Map; + +public final class StorageApplianceImpl + implements StorageAppliance, StorageAppliance.Definition, StorageAppliance.Update { + private StorageApplianceInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AdministrativeCredentials administratorCredentials() { + return this.innerModel().administratorCredentials(); + } + + public Long capacity() { + return this.innerModel().capacity(); + } + + public Long capacityUsed() { + return this.innerModel().capacityUsed(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public StorageApplianceDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public String managementIpv4Address() { + return this.innerModel().managementIpv4Address(); + } + + public StorageApplianceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String rackId() { + return this.innerModel().rackId(); + } + + public long rackSlot() { + return this.innerModel().rackSlot(); + } + + public RemoteVendorManagementFeature remoteVendorManagementFeature() { + return this.innerModel().remoteVendorManagementFeature(); + } + + public RemoteVendorManagementStatus remoteVendorManagementStatus() { + return this.innerModel().remoteVendorManagementStatus(); + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public String storageApplianceSkuId() { + return this.innerModel().storageApplianceSkuId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageApplianceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageApplianceName; + + private StorageAppliancePatchParameters updateStorageApplianceUpdateParameters; + + public StorageApplianceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageAppliance create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAppliances() + .createOrUpdate(resourceGroupName, storageApplianceName, this.innerModel(), Context.NONE); + return this; + } + + public StorageAppliance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAppliances() + .createOrUpdate(resourceGroupName, storageApplianceName, this.innerModel(), context); + return this; + } + + StorageApplianceImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new StorageApplianceInner(); + this.serviceManager = serviceManager; + this.storageApplianceName = name; + } + + public StorageApplianceImpl update() { + this.updateStorageApplianceUpdateParameters = new StorageAppliancePatchParameters(); + return this; + } + + public StorageAppliance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAppliances() + .update(resourceGroupName, storageApplianceName, updateStorageApplianceUpdateParameters, Context.NONE); + return this; + } + + public StorageAppliance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAppliances() + .update(resourceGroupName, storageApplianceName, updateStorageApplianceUpdateParameters, context); + return this; + } + + StorageApplianceImpl( + StorageApplianceInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageApplianceName = Utils.getValueFromIdByName(innerObject.id(), "storageAppliances"); + } + + public StorageAppliance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAppliances() + .getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, Context.NONE) + .getValue(); + return this; + } + + public StorageAppliance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAppliances() + .getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, context) + .getValue(); + return this; + } + + public void disableRemoteVendorManagement() { + serviceManager.storageAppliances().disableRemoteVendorManagement(resourceGroupName, storageApplianceName); + } + + public void disableRemoteVendorManagement(Context context) { + serviceManager + .storageAppliances() + .disableRemoteVendorManagement(resourceGroupName, storageApplianceName, context); + } + + public void enableRemoteVendorManagement() { + serviceManager.storageAppliances().enableRemoteVendorManagement(resourceGroupName, storageApplianceName); + } + + public void enableRemoteVendorManagement( + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context) { + serviceManager + .storageAppliances() + .enableRemoteVendorManagement( + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + context); + } + + public void runReadCommands(StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + serviceManager + .storageAppliances() + .runReadCommands(resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters); + } + + public void runReadCommands( + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, Context context) { + serviceManager + .storageAppliances() + .runReadCommands( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, context); + } + + public void validateHardware( + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + serviceManager + .storageAppliances() + .validateHardware(resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters); + } + + public void validateHardware( + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, Context context) { + serviceManager + .storageAppliances() + .validateHardware( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, context); + } + + public StorageApplianceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public StorageApplianceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public StorageApplianceImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public StorageApplianceImpl withAdministratorCredentials(AdministrativeCredentials administratorCredentials) { + this.innerModel().withAdministratorCredentials(administratorCredentials); + return this; + } + + public StorageApplianceImpl withRackId(String rackId) { + this.innerModel().withRackId(rackId); + return this; + } + + public StorageApplianceImpl withRackSlot(long rackSlot) { + this.innerModel().withRackSlot(rackSlot); + return this; + } + + public StorageApplianceImpl withSerialNumber(String serialNumber) { + if (isInCreateMode()) { + this.innerModel().withSerialNumber(serialNumber); + return this; + } else { + this.updateStorageApplianceUpdateParameters.withSerialNumber(serialNumber); + return this; + } + } + + public StorageApplianceImpl withStorageApplianceSkuId(String storageApplianceSkuId) { + this.innerModel().withStorageApplianceSkuId(storageApplianceSkuId); + return this; + } + + public StorageApplianceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateStorageApplianceUpdateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java new file mode 100644 index 000000000000..45dbd1039664 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesClientImpl.java @@ -0,0 +1,3145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.StorageAppliancesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceList; +import com.azure.resourcemanager.networkcloud.models.StorageAppliancePatchParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceValidateHardwareParameters; +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 StorageAppliancesClient. */ +public final class StorageAppliancesClientImpl implements StorageAppliancesClient { + /** The proxy service used to perform REST calls. */ + private final StorageAppliancesService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of StorageAppliancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageAppliancesClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(StorageAppliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudStorageAppliances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudStorageA") + public interface StorageAppliancesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @BodyParam("application/json") StorageApplianceInner storageApplianceParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @BodyParam("application/json") StorageAppliancePatchParameters storageApplianceUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableRemoteVendorManagement( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableRemoteVendorManagement( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @BodyParam("application/json") + StorageApplianceEnableRemoteVendorManagementParameters + storageApplianceEnableRemoteVendorManagementParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/runReadCommands") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runReadCommands( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @BodyParam("application/json") + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/validateHardware") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateHardware( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageApplianceName") String storageApplianceName, + @BodyParam("application/json") + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 list of storage appliances in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 list of storage appliances in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 list of storage appliances in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 list of storage appliances in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 list of storage appliances in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 list of storage appliances in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of storage appliances in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of storage appliances in the provided resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of storage appliances in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of storage appliances in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of storage appliances in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of storage appliances in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String storageApplianceName) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String storageApplianceName, 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + accept, + context); + } + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String storageApplianceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageApplianceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storageApplianceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageApplianceName, context).block(); + } + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageApplianceInner getByResourceGroup(String resourceGroupName, String storageApplianceName) { + return getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, Context.NONE).getValue(); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageApplianceParameters is required and cannot be null.")); + } else { + storageApplianceParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageApplianceParameters is required and cannot be null.")); + } else { + storageApplianceParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceParameters, + accept, + context); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageApplianceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, storageApplianceName, storageApplianceParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageApplianceInner.class, + StorageApplianceInner.class, + this.client.getContext()); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageApplianceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), StorageApplianceInner.class, StorageApplianceInner.class, context); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceParameters) + .getSyncPoller(); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageApplianceInner> beginCreateOrUpdate( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageApplianceInner createOrUpdate( + String resourceGroupName, String storageApplianceName, StorageApplianceInner storageApplianceParameters) { + return createOrUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceParameters).block(); + } + + /** + * Create or update the storage appliance. + * + *

Create a new storage appliance or update the properties of the existing one. All customer initiated requests + * will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageApplianceInner createOrUpdate( + String resourceGroupName, + String storageApplianceName, + StorageApplianceInner storageApplianceParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceParameters, context) + .block(); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String storageApplianceName) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String storageApplianceName, 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + accept, + context); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageApplianceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageApplianceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName) { + return this.beginDeleteAsync(resourceGroupName, storageApplianceName).getSyncPoller(); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, storageApplianceName, context).getSyncPoller(); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName) { + return beginDeleteAsync(resourceGroupName, storageApplianceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageApplianceName, Context context) { + return beginDeleteAsync(resourceGroupName, storageApplianceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 delete(String resourceGroupName, String storageApplianceName) { + deleteAsync(resourceGroupName, storageApplianceName).block(); + } + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 delete(String resourceGroupName, String storageApplianceName, Context context) { + deleteAsync(resourceGroupName, storageApplianceName, context).block(); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceUpdateParameters != null) { + storageApplianceUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceUpdateParameters != null) { + storageApplianceUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceUpdateParameters, + accept, + context); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageApplianceInner> beginUpdateAsync( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageApplianceInner.class, + StorageApplianceInner.class, + this.client.getContext()); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageApplianceInner> beginUpdateAsync( + String resourceGroupName, String storageApplianceName) { + final StorageAppliancePatchParameters storageApplianceUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageApplianceInner.class, + StorageApplianceInner.class, + this.client.getContext()); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageApplianceInner> beginUpdateAsync( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), StorageApplianceInner.class, StorageApplianceInner.class, context); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageApplianceInner> beginUpdate( + String resourceGroupName, String storageApplianceName) { + final StorageAppliancePatchParameters storageApplianceUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage + * appliance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageApplianceInner> beginUpdate( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters) { + return beginUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageAppliance represents on-premises Network Cloud storage appliance on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String storageApplianceName) { + final StorageAppliancePatchParameters storageApplianceUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageApplianceInner update(String resourceGroupName, String storageApplianceName) { + final StorageAppliancePatchParameters storageApplianceUpdateParameters = null; + return updateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters).block(); + } + + /** + * Patch the storage appliance. + * + *

Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceUpdateParameters The request body. + * @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 storageAppliance represents on-premises Network Cloud storage appliance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageApplianceInner update( + String resourceGroupName, + String storageApplianceName, + StorageAppliancePatchParameters storageApplianceUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, storageApplianceName, storageApplianceUpdateParameters, context).block(); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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>> disableRemoteVendorManagementWithResponseAsync( + String resourceGroupName, String storageApplianceName) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableRemoteVendorManagement( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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>> disableRemoteVendorManagementWithResponseAsync( + String resourceGroupName, String storageApplianceName, 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableRemoteVendorManagement( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + accept, + context); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginDisableRemoteVendorManagementAsync( + String resourceGroupName, String storageApplianceName) { + Mono>> mono = + disableRemoteVendorManagementWithResponseAsync(resourceGroupName, storageApplianceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginDisableRemoteVendorManagementAsync( + String resourceGroupName, String storageApplianceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableRemoteVendorManagementWithResponseAsync(resourceGroupName, storageApplianceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginDisableRemoteVendorManagement( + String resourceGroupName, String storageApplianceName) { + return this.beginDisableRemoteVendorManagementAsync(resourceGroupName, storageApplianceName).getSyncPoller(); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginDisableRemoteVendorManagement( + String resourceGroupName, String storageApplianceName, Context context) { + return this + .beginDisableRemoteVendorManagementAsync(resourceGroupName, storageApplianceName, context) + .getSyncPoller(); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagementAsync(String resourceGroupName, String storageApplianceName) { + return beginDisableRemoteVendorManagementAsync(resourceGroupName, storageApplianceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagementAsync( + String resourceGroupName, String storageApplianceName, Context context) { + return beginDisableRemoteVendorManagementAsync(resourceGroupName, storageApplianceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName) { + disableRemoteVendorManagementAsync(resourceGroupName, storageApplianceName).block(); + } + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName, Context context) { + disableRemoteVendorManagementAsync(resourceGroupName, storageApplianceName, context).block(); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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>> enableRemoteVendorManagementWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceEnableRemoteVendorManagementParameters != null) { + storageApplianceEnableRemoteVendorManagementParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableRemoteVendorManagement( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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>> enableRemoteVendorManagementWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceEnableRemoteVendorManagementParameters != null) { + storageApplianceEnableRemoteVendorManagementParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableRemoteVendorManagement( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + accept, + context); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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> beginEnableRemoteVendorManagementAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters) { + Mono>> mono = + enableRemoteVendorManagementWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceEnableRemoteVendorManagementParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginEnableRemoteVendorManagementAsync( + String resourceGroupName, String storageApplianceName) { + final StorageApplianceEnableRemoteVendorManagementParameters + storageApplianceEnableRemoteVendorManagementParameters = null; + Mono>> mono = + enableRemoteVendorManagementWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceEnableRemoteVendorManagementParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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> beginEnableRemoteVendorManagementAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableRemoteVendorManagementWithResponseAsync( + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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> beginEnableRemoteVendorManagement( + String resourceGroupName, String storageApplianceName) { + final StorageApplianceEnableRemoteVendorManagementParameters + storageApplianceEnableRemoteVendorManagementParameters = null; + return this + .beginEnableRemoteVendorManagementAsync( + resourceGroupName, storageApplianceName, storageApplianceEnableRemoteVendorManagementParameters) + .getSyncPoller(); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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> beginEnableRemoteVendorManagement( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context) { + return this + .beginEnableRemoteVendorManagementAsync( + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + context) + .getSyncPoller(); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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 enableRemoteVendorManagementAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters) { + return beginEnableRemoteVendorManagementAsync( + resourceGroupName, storageApplianceName, storageApplianceEnableRemoteVendorManagementParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 enableRemoteVendorManagementAsync(String resourceGroupName, String storageApplianceName) { + final StorageApplianceEnableRemoteVendorManagementParameters + storageApplianceEnableRemoteVendorManagementParameters = null; + return beginEnableRemoteVendorManagementAsync( + resourceGroupName, storageApplianceName, storageApplianceEnableRemoteVendorManagementParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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 enableRemoteVendorManagementAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context) { + return beginEnableRemoteVendorManagementAsync( + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 enableRemoteVendorManagement(String resourceGroupName, String storageApplianceName) { + final StorageApplianceEnableRemoteVendorManagementParameters + storageApplianceEnableRemoteVendorManagementParameters = null; + enableRemoteVendorManagementAsync( + resourceGroupName, storageApplianceName, storageApplianceEnableRemoteVendorManagementParameters) + .block(); + } + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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 enableRemoteVendorManagement( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context) { + enableRemoteVendorManagementAsync( + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + context) + .block(); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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>> runReadCommandsWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceRunReadCommandsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageApplianceRunReadCommandsParameters is required and cannot be null.")); + } else { + storageApplianceRunReadCommandsParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .runReadCommands( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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>> runReadCommandsWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceRunReadCommandsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageApplianceRunReadCommandsParameters is required and cannot be null.")); + } else { + storageApplianceRunReadCommandsParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .runReadCommands( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceRunReadCommandsParameters, + accept, + context); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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> beginRunReadCommandsAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + Mono>> mono = + runReadCommandsWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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> beginRunReadCommandsAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runReadCommandsWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + return this + .beginRunReadCommandsAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters) + .getSyncPoller(); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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> beginRunReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context) { + return this + .beginRunReadCommandsAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, context) + .getSyncPoller(); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommandsAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + return beginRunReadCommandsAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommandsAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context) { + return beginRunReadCommandsAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + runReadCommandsAsync(resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters) + .block(); + } + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context) { + runReadCommandsAsync( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, context) + .block(); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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>> validateHardwareWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceValidateHardwareParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageApplianceValidateHardwareParameters is required and cannot be null.")); + } else { + storageApplianceValidateHardwareParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateHardware( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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>> validateHardwareWithResponseAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + 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 (storageApplianceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageApplianceName is required and cannot be null.")); + } + if (storageApplianceValidateHardwareParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter storageApplianceValidateHardwareParameters is required and cannot be null.")); + } else { + storageApplianceValidateHardwareParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateHardware( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + storageApplianceName, + storageApplianceValidateHardwareParameters, + accept, + context); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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> beginValidateHardwareAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + Mono>> mono = + validateHardwareWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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> beginValidateHardwareAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateHardwareWithResponseAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + return this + .beginValidateHardwareAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters) + .getSyncPoller(); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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> beginValidateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context) { + return this + .beginValidateHardwareAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, context) + .getSyncPoller(); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardwareAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + return beginValidateHardwareAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardwareAsync( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context) { + return beginValidateHardwareAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + validateHardwareAsync(resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters) + .block(); + } + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context) { + validateHardwareAsync( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 storageApplianceList represents a list of storage appliances along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java new file mode 100644 index 000000000000..2ec095d5bf18 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/StorageAppliancesImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.StorageAppliancesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner; +import com.azure.resourcemanager.networkcloud.models.StorageAppliance; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceValidateHardwareParameters; +import com.azure.resourcemanager.networkcloud.models.StorageAppliances; + +public final class StorageAppliancesImpl implements StorageAppliances { + private static final ClientLogger LOGGER = new ClientLogger(StorageAppliancesImpl.class); + + private final StorageAppliancesClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public StorageAppliancesImpl( + StorageAppliancesClient innerClient, + com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageApplianceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storageApplianceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageApplianceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageAppliance getByResourceGroup(String resourceGroupName, String storageApplianceName) { + StorageApplianceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, storageApplianceName); + if (inner != null) { + return new StorageApplianceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String storageApplianceName) { + this.serviceClient().delete(resourceGroupName, storageApplianceName); + } + + public void delete(String resourceGroupName, String storageApplianceName, Context context) { + this.serviceClient().delete(resourceGroupName, storageApplianceName, context); + } + + public void disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName) { + this.serviceClient().disableRemoteVendorManagement(resourceGroupName, storageApplianceName); + } + + public void disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName, Context context) { + this.serviceClient().disableRemoteVendorManagement(resourceGroupName, storageApplianceName, context); + } + + public void enableRemoteVendorManagement(String resourceGroupName, String storageApplianceName) { + this.serviceClient().enableRemoteVendorManagement(resourceGroupName, storageApplianceName); + } + + public void enableRemoteVendorManagement( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context) { + this + .serviceClient() + .enableRemoteVendorManagement( + resourceGroupName, + storageApplianceName, + storageApplianceEnableRemoteVendorManagementParameters, + context); + } + + public void runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters) { + this + .serviceClient() + .runReadCommands(resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters); + } + + public void runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context) { + this + .serviceClient() + .runReadCommands( + resourceGroupName, storageApplianceName, storageApplianceRunReadCommandsParameters, context); + } + + public void validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters) { + this + .serviceClient() + .validateHardware(resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters); + } + + public void validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context) { + this + .serviceClient() + .validateHardware( + resourceGroupName, storageApplianceName, storageApplianceValidateHardwareParameters, context); + } + + public StorageAppliance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + if (storageApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + if (storageApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageApplianceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + if (storageApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); + } + this.delete(resourceGroupName, storageApplianceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageApplianceName = Utils.getValueFromIdByName(id, "storageAppliances"); + if (storageApplianceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAppliances'.", id))); + } + this.delete(resourceGroupName, storageApplianceName, context); + } + + private StorageAppliancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public StorageApplianceImpl define(String name) { + return new StorageApplianceImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java new file mode 100644 index 000000000000..dea02b084071 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworkImpl.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkPatchParameters; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class TrunkedNetworkImpl implements TrunkedNetwork, TrunkedNetwork.Definition, TrunkedNetwork.Update { + private TrunkedNetworkInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public TrunkedNetworkDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public List hybridAksClustersAssociatedIds() { + List inner = this.innerModel().hybridAksClustersAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HybridAksPluginType hybridAksPluginType() { + return this.innerModel().hybridAksPluginType(); + } + + public String interfaceName() { + return this.innerModel().interfaceName(); + } + + public List isolationDomainIds() { + List inner = this.innerModel().isolationDomainIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TrunkedNetworkProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List virtualMachinesAssociatedIds() { + List inner = this.innerModel().virtualMachinesAssociatedIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vlans() { + List inner = this.innerModel().vlans(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TrunkedNetworkInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String trunkedNetworkName; + + private TrunkedNetworkPatchParameters updateTrunkedNetworkUpdateParameters; + + public TrunkedNetworkImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public TrunkedNetwork create() { + this.innerObject = + serviceManager + .serviceClient() + .getTrunkedNetworks() + .createOrUpdate(resourceGroupName, trunkedNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public TrunkedNetwork create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTrunkedNetworks() + .createOrUpdate(resourceGroupName, trunkedNetworkName, this.innerModel(), context); + return this; + } + + TrunkedNetworkImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new TrunkedNetworkInner(); + this.serviceManager = serviceManager; + this.trunkedNetworkName = name; + } + + public TrunkedNetworkImpl update() { + this.updateTrunkedNetworkUpdateParameters = new TrunkedNetworkPatchParameters(); + return this; + } + + public TrunkedNetwork apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTrunkedNetworks() + .updateWithResponse( + resourceGroupName, trunkedNetworkName, updateTrunkedNetworkUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public TrunkedNetwork apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTrunkedNetworks() + .updateWithResponse( + resourceGroupName, trunkedNetworkName, updateTrunkedNetworkUpdateParameters, context) + .getValue(); + return this; + } + + TrunkedNetworkImpl( + TrunkedNetworkInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.trunkedNetworkName = Utils.getValueFromIdByName(innerObject.id(), "trunkedNetworks"); + } + + public TrunkedNetwork refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTrunkedNetworks() + .getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, Context.NONE) + .getValue(); + return this; + } + + public TrunkedNetwork refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTrunkedNetworks() + .getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, context) + .getValue(); + return this; + } + + public TrunkedNetworkImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public TrunkedNetworkImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public TrunkedNetworkImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public TrunkedNetworkImpl withIsolationDomainIds(List isolationDomainIds) { + this.innerModel().withIsolationDomainIds(isolationDomainIds); + return this; + } + + public TrunkedNetworkImpl withVlans(List vlans) { + this.innerModel().withVlans(vlans); + return this; + } + + public TrunkedNetworkImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTrunkedNetworkUpdateParameters.withTags(tags); + return this; + } + } + + public TrunkedNetworkImpl withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) { + this.innerModel().withHybridAksPluginType(hybridAksPluginType); + return this; + } + + public TrunkedNetworkImpl withInterfaceName(String interfaceName) { + this.innerModel().withInterfaceName(interfaceName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java new file mode 100644 index 000000000000..2e3de4c94d18 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksClientImpl.java @@ -0,0 +1,1571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.TrunkedNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkList; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkPatchParameters; +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 TrunkedNetworksClient. */ +public final class TrunkedNetworksClientImpl implements TrunkedNetworksClient { + /** The proxy service used to perform REST calls. */ + private final TrunkedNetworksService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of TrunkedNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TrunkedNetworksClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(TrunkedNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudTrunkedNetworks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudTrunkedN") + public interface TrunkedNetworksService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("trunkedNetworkName") String trunkedNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("trunkedNetworkName") String trunkedNetworkName, + @BodyParam("application/json") TrunkedNetworkInner trunkedNetworkParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("trunkedNetworkName") String trunkedNetworkName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("trunkedNetworkName") String trunkedNetworkName, + @BodyParam("application/json") TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 list of trunked networks in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 list of trunked networks in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 list of trunked networks in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 list of trunked networks in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of trunked networks in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of trunked networks in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of trunked networks in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of trunked networks in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of trunked networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of trunked networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String trunkedNetworkName) { + 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String trunkedNetworkName, 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + accept, + context); + } + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String trunkedNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, trunkedNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String trunkedNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, trunkedNetworkName, context).block(); + } + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrunkedNetworkInner getByResourceGroup(String resourceGroupName, String trunkedNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, Context.NONE).getValue(); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters) { + 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + if (trunkedNetworkParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter trunkedNetworkParameters is required and cannot be null.")); + } else { + trunkedNetworkParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + if (trunkedNetworkParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter trunkedNetworkParameters is required and cannot be null.")); + } else { + trunkedNetworkParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + trunkedNetworkParameters, + accept, + context); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple + * isolation domains and specified VLANs to create a trunked network. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TrunkedNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TrunkedNetworkInner.class, + TrunkedNetworkInner.class, + this.client.getContext()); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple + * isolation domains and specified VLANs to create a trunked network. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TrunkedNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TrunkedNetworkInner.class, TrunkedNetworkInner.class, context); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple + * isolation domains and specified VLANs to create a trunked network. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters) + .getSyncPoller(); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple + * isolation domains and specified VLANs to create a trunked network. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TrunkedNetworkInner> beginCreateOrUpdate( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrunkedNetworkInner createOrUpdate( + String resourceGroupName, String trunkedNetworkName, TrunkedNetworkInner trunkedNetworkParameters) { + return createOrUpdateAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters).block(); + } + + /** + * Create or update the trunked network. + * + *

Create a new trunked network or update the properties of the existing trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrunkedNetworkInner createOrUpdate( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkInner trunkedNetworkParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkParameters, context).block(); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String trunkedNetworkName) { + 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String trunkedNetworkName, 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + accept, + context); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, trunkedNetworkName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, trunkedNetworkName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName) { + return this.beginDeleteAsync(resourceGroupName, trunkedNetworkName).getSyncPoller(); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName, Context context) { + return this.beginDeleteAsync(resourceGroupName, trunkedNetworkName, context).getSyncPoller(); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName) { + return beginDeleteAsync(resourceGroupName, trunkedNetworkName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetworkName, Context context) { + return beginDeleteAsync(resourceGroupName, trunkedNetworkName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 delete(String resourceGroupName, String trunkedNetworkName) { + deleteAsync(resourceGroupName, trunkedNetworkName).block(); + } + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 delete(String resourceGroupName, String trunkedNetworkName, Context context) { + deleteAsync(resourceGroupName, trunkedNetworkName, context).block(); + } + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkUpdateParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters) { + 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + if (trunkedNetworkUpdateParameters != null) { + trunkedNetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + trunkedNetworkUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkUpdateParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters, + 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 (trunkedNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter trunkedNetworkName is required and cannot be null.")); + } + if (trunkedNetworkUpdateParameters != null) { + trunkedNetworkUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + trunkedNetworkName, + trunkedNetworkUpdateParameters, + accept, + context); + } + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String trunkedNetworkName) { + final TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @param trunkedNetworkUpdateParameters The request body. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String trunkedNetworkName, + TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, trunkedNetworkName, trunkedNetworkUpdateParameters, context) + .block(); + } + + /** + * Patch the trunked network. + * + *

Update tags associated with the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 trunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to + * create a trunked network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrunkedNetworkInner update(String resourceGroupName, String trunkedNetworkName) { + final TrunkedNetworkPatchParameters trunkedNetworkUpdateParameters = null; + return updateWithResponse(resourceGroupName, trunkedNetworkName, trunkedNetworkUpdateParameters, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 trunkedNetworkList represents a list of trunked networks along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java new file mode 100644 index 000000000000..2f40858a822e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/TrunkedNetworksImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.TrunkedNetworksClient; +import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; +import com.azure.resourcemanager.networkcloud.models.TrunkedNetworks; + +public final class TrunkedNetworksImpl implements TrunkedNetworks { + private static final ClientLogger LOGGER = new ClientLogger(TrunkedNetworksImpl.class); + + private final TrunkedNetworksClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public TrunkedNetworksImpl( + TrunkedNetworksClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new TrunkedNetworkImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String trunkedNetworkName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TrunkedNetworkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TrunkedNetwork getByResourceGroup(String resourceGroupName, String trunkedNetworkName) { + TrunkedNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, trunkedNetworkName); + if (inner != null) { + return new TrunkedNetworkImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String trunkedNetworkName) { + this.serviceClient().delete(resourceGroupName, trunkedNetworkName); + } + + public void delete(String resourceGroupName, String trunkedNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, trunkedNetworkName, context); + } + + public TrunkedNetwork getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + if (trunkedNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + if (trunkedNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, trunkedNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + if (trunkedNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); + } + this.delete(resourceGroupName, trunkedNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String trunkedNetworkName = Utils.getValueFromIdByName(id, "trunkedNetworks"); + if (trunkedNetworkName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'trunkedNetworks'.", id))); + } + this.delete(resourceGroupName, trunkedNetworkName, context); + } + + private TrunkedNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public TrunkedNetworkImpl define(String name) { + return new TrunkedNetworkImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/Utils.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/Utils.java new file mode 100644 index 000000000000..aa1eff8c1316 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java new file mode 100644 index 000000000000..c72acb7ed9e9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachineImpl.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.azure.resourcemanager.networkcloud.models.StorageProfile; +import com.azure.resourcemanager.networkcloud.models.VirtualMachine; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineBootMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDeviceModelType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineIsolateEmulatorThread; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePatchParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHint; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerState; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineProvisioningState; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVirtioInterfaceType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualMachineImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { + private VirtualMachineInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String adminUsername() { + return this.innerModel().adminUsername(); + } + + public String bareMetalMachineId() { + return this.innerModel().bareMetalMachineId(); + } + + public VirtualMachineBootMethod bootMethod() { + return this.innerModel().bootMethod(); + } + + public NetworkAttachment cloudServicesNetworkAttachment() { + return this.innerModel().cloudServicesNetworkAttachment(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public long cpuCores() { + return this.innerModel().cpuCores(); + } + + public VirtualMachineDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public VirtualMachineIsolateEmulatorThread isolateEmulatorThread() { + return this.innerModel().isolateEmulatorThread(); + } + + public long memorySizeGB() { + return this.innerModel().memorySizeGB(); + } + + public List networkAttachments() { + List inner = this.innerModel().networkAttachments(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String networkData() { + return this.innerModel().networkData(); + } + + public List placementHints() { + List inner = this.innerModel().placementHints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VirtualMachinePowerState powerState() { + return this.innerModel().powerState(); + } + + public VirtualMachineProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List sshPublicKeys() { + List inner = this.innerModel().sshPublicKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StorageProfile storageProfile() { + return this.innerModel().storageProfile(); + } + + public String userData() { + return this.innerModel().userData(); + } + + public VirtualMachineVirtioInterfaceType virtioInterface() { + return this.innerModel().virtioInterface(); + } + + public VirtualMachineDeviceModelType vmDeviceModel() { + return this.innerModel().vmDeviceModel(); + } + + public String vmImage() { + return this.innerModel().vmImage(); + } + + public ImageRepositoryCredentials vmImageRepositoryCredentials() { + return this.innerModel().vmImageRepositoryCredentials(); + } + + public List volumes() { + List inner = this.innerModel().volumes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualMachineName; + + private VirtualMachinePatchParameters updateVirtualMachineUpdateParameters; + + public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public VirtualMachine create() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .createOrUpdate(resourceGroupName, virtualMachineName, this.innerModel(), Context.NONE); + return this; + } + + public VirtualMachine create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .createOrUpdate(resourceGroupName, virtualMachineName, this.innerModel(), context); + return this; + } + + VirtualMachineImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new VirtualMachineInner(); + this.serviceManager = serviceManager; + this.virtualMachineName = name; + } + + public VirtualMachineImpl update() { + this.updateVirtualMachineUpdateParameters = new VirtualMachinePatchParameters(); + return this; + } + + public VirtualMachine apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .update(resourceGroupName, virtualMachineName, updateVirtualMachineUpdateParameters, Context.NONE); + return this; + } + + public VirtualMachine apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .update(resourceGroupName, virtualMachineName, updateVirtualMachineUpdateParameters, context); + return this; + } + + VirtualMachineImpl( + VirtualMachineInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); + } + + public VirtualMachine refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, Context.NONE) + .getValue(); + return this; + } + + public VirtualMachine refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVirtualMachines() + .getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context) + .getValue(); + return this; + } + + public void attachVolume(VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + serviceManager + .virtualMachines() + .attachVolume(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters); + } + + public void attachVolume(VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, Context context) { + serviceManager + .virtualMachines() + .attachVolume(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, context); + } + + public void detachVolume(VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + serviceManager + .virtualMachines() + .detachVolume(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters); + } + + public void detachVolume(VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, Context context) { + serviceManager + .virtualMachines() + .detachVolume(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, context); + } + + public void powerOff() { + serviceManager.virtualMachines().powerOff(resourceGroupName, virtualMachineName); + } + + public void powerOff(VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, Context context) { + serviceManager + .virtualMachines() + .powerOff(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters, context); + } + + public void reimage() { + serviceManager.virtualMachines().reimage(resourceGroupName, virtualMachineName); + } + + public void reimage(Context context) { + serviceManager.virtualMachines().reimage(resourceGroupName, virtualMachineName, context); + } + + public void restart() { + serviceManager.virtualMachines().restart(resourceGroupName, virtualMachineName); + } + + public void restart(Context context) { + serviceManager.virtualMachines().restart(resourceGroupName, virtualMachineName, context); + } + + public void start() { + serviceManager.virtualMachines().start(resourceGroupName, virtualMachineName); + } + + public void start(Context context) { + serviceManager.virtualMachines().start(resourceGroupName, virtualMachineName, context); + } + + public VirtualMachineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VirtualMachineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VirtualMachineImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VirtualMachineImpl withAdminUsername(String adminUsername) { + this.innerModel().withAdminUsername(adminUsername); + return this; + } + + public VirtualMachineImpl withCloudServicesNetworkAttachment(NetworkAttachment cloudServicesNetworkAttachment) { + this.innerModel().withCloudServicesNetworkAttachment(cloudServicesNetworkAttachment); + return this; + } + + public VirtualMachineImpl withCpuCores(long cpuCores) { + this.innerModel().withCpuCores(cpuCores); + return this; + } + + public VirtualMachineImpl withMemorySizeGB(long memorySizeGB) { + this.innerModel().withMemorySizeGB(memorySizeGB); + return this; + } + + public VirtualMachineImpl withStorageProfile(StorageProfile storageProfile) { + this.innerModel().withStorageProfile(storageProfile); + return this; + } + + public VirtualMachineImpl withVmImage(String vmImage) { + this.innerModel().withVmImage(vmImage); + return this; + } + + public VirtualMachineImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVirtualMachineUpdateParameters.withTags(tags); + return this; + } + } + + public VirtualMachineImpl withBootMethod(VirtualMachineBootMethod bootMethod) { + this.innerModel().withBootMethod(bootMethod); + return this; + } + + public VirtualMachineImpl withIsolateEmulatorThread(VirtualMachineIsolateEmulatorThread isolateEmulatorThread) { + this.innerModel().withIsolateEmulatorThread(isolateEmulatorThread); + return this; + } + + public VirtualMachineImpl withNetworkAttachments(List networkAttachments) { + this.innerModel().withNetworkAttachments(networkAttachments); + return this; + } + + public VirtualMachineImpl withNetworkData(String networkData) { + this.innerModel().withNetworkData(networkData); + return this; + } + + public VirtualMachineImpl withPlacementHints(List placementHints) { + this.innerModel().withPlacementHints(placementHints); + return this; + } + + public VirtualMachineImpl withSshPublicKeys(List sshPublicKeys) { + this.innerModel().withSshPublicKeys(sshPublicKeys); + return this; + } + + public VirtualMachineImpl withUserData(String userData) { + this.innerModel().withUserData(userData); + return this; + } + + public VirtualMachineImpl withVirtioInterface(VirtualMachineVirtioInterfaceType virtioInterface) { + this.innerModel().withVirtioInterface(virtioInterface); + return this; + } + + public VirtualMachineImpl withVmDeviceModel(VirtualMachineDeviceModelType vmDeviceModel) { + this.innerModel().withVmDeviceModel(vmDeviceModel); + return this; + } + + public VirtualMachineImpl withVmImageRepositoryCredentials( + ImageRepositoryCredentials vmImageRepositoryCredentials) { + if (isInCreateMode()) { + this.innerModel().withVmImageRepositoryCredentials(vmImageRepositoryCredentials); + return this; + } else { + this.updateVirtualMachineUpdateParameters.withVmImageRepositoryCredentials(vmImageRepositoryCredentials); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java new file mode 100644 index 000000000000..f705abdf0505 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesClientImpl.java @@ -0,0 +1,3598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineList; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePatchParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; +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 VirtualMachinesClient. */ +public final class VirtualMachinesClientImpl implements VirtualMachinesClient { + /** The proxy service used to perform REST calls. */ + private final VirtualMachinesService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of VirtualMachinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachinesClientImpl(NetworkCloudImpl client) { + this.service = + RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudVirtualMachines to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudVirtualM") + public interface VirtualMachinesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @BodyParam("application/json") VirtualMachineInner virtualMachineParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @BodyParam("application/json") VirtualMachinePatchParameters virtualMachineUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/attachVolume") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> attachVolume( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @BodyParam("application/json") VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/detachVolume") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> detachVolume( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @BodyParam("application/json") VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> powerOff( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @BodyParam("application/json") VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualMachineName") String virtualMachineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 list of virtual machines in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 list of virtual machines in the provided subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 list of virtual machines in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 list of virtual machines in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of virtual machines in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of virtual machines in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of virtual machines in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of virtual machines in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of virtual machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of virtual machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context); + } + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualMachineName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualMachineParameters is required and cannot be null.")); + } else { + virtualMachineParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter virtualMachineParameters is required and cannot be null.")); + } else { + virtualMachineParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineParameters, + accept, + context); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInner.class, + VirtualMachineInner.class, + this.client.getContext()); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineParameters) + .getSyncPoller(); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineParameters, context) + .getSyncPoller(); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner createOrUpdate( + String resourceGroupName, String virtualMachineName, VirtualMachineInner virtualMachineParameters) { + return createOrUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineParameters).block(); + } + + /** + * Create or update the virtual machine. + * + *

Create a new virtual machine or update the properties of the existing virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner createOrUpdate( + String resourceGroupName, + String virtualMachineName, + VirtualMachineInner virtualMachineParameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineParameters, context).block(); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName) { + return this.beginDeleteAsync(resourceGroupName, virtualMachineName).getSyncPoller(); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName) { + return beginDeleteAsync(resourceGroupName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachineName, Context context) { + return beginDeleteAsync(resourceGroupName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 delete(String resourceGroupName, String virtualMachineName) { + deleteAsync(resourceGroupName, virtualMachineName).block(); + } + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 delete(String resourceGroupName, String virtualMachineName, Context context) { + deleteAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineUpdateParameters != null) { + virtualMachineUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineUpdateParameters != null) { + virtualMachineUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineUpdateParameters, + accept, + context); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInner> beginUpdateAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInner.class, + VirtualMachineInner.class, + this.client.getContext()); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInner> beginUpdateAsync( + String resourceGroupName, String virtualMachineName) { + final VirtualMachinePatchParameters virtualMachineUpdateParameters = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VirtualMachineInner.class, + VirtualMachineInner.class, + this.client.getContext()); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInner> beginUpdateAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, String virtualMachineName) { + final VirtualMachinePatchParameters virtualMachineUpdateParameters = null; + return this + .beginUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters) + .getSyncPoller(); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual + * machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInner> beginUpdate( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters) { + return beginUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String virtualMachineName) { + final VirtualMachinePatchParameters virtualMachineUpdateParameters = null; + return beginUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner update(String resourceGroupName, String virtualMachineName) { + final VirtualMachinePatchParameters virtualMachineUpdateParameters = null; + return updateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters).block(); + } + + /** + * Patch the virtual machine. + * + *

Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. + * Properties and tag updates can be done independently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineUpdateParameters The request body. + * @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 virtualMachine represents the on-premises Network Cloud virtual machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInner update( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePatchParameters virtualMachineUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, virtualMachineName, virtualMachineUpdateParameters, context).block(); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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>> attachVolumeWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineAttachVolumeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineAttachVolumeParameters is required and cannot be null.")); + } else { + virtualMachineAttachVolumeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .attachVolume( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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>> attachVolumeWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineAttachVolumeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineAttachVolumeParameters is required and cannot be null.")); + } else { + virtualMachineAttachVolumeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .attachVolume( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineAttachVolumeParameters, + accept, + context); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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> beginAttachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + Mono>> mono = + attachVolumeWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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> beginAttachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + attachVolumeWithResponseAsync( + resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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> beginAttachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + return this + .beginAttachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters) + .getSyncPoller(); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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> beginAttachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context) { + return this + .beginAttachVolumeAsync( + resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, context) + .getSyncPoller(); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + return beginAttachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context) { + return beginAttachVolumeAsync( + resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + attachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters).block(); + } + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context) { + attachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, context).block(); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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>> detachVolumeWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineDetachVolumeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineDetachVolumeParameters is required and cannot be null.")); + } else { + virtualMachineDetachVolumeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .detachVolume( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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>> detachVolumeWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachineDetachVolumeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter virtualMachineDetachVolumeParameters is required and cannot be null.")); + } else { + virtualMachineDetachVolumeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .detachVolume( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachineDetachVolumeParameters, + accept, + context); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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> beginDetachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + Mono>> mono = + detachVolumeWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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> beginDetachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + detachVolumeWithResponseAsync( + resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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> beginDetachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + return this + .beginDetachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters) + .getSyncPoller(); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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> beginDetachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context) { + return this + .beginDetachVolumeAsync( + resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, context) + .getSyncPoller(); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + return beginDetachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolumeAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context) { + return beginDetachVolumeAsync( + resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + detachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters).block(); + } + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context) { + detachVolumeAsync(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, context).block(); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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>> powerOffWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachinePowerOffParameters != null) { + virtualMachinePowerOffParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .powerOff( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachinePowerOffParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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>> powerOffWithResponseAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + if (virtualMachinePowerOffParameters != null) { + virtualMachinePowerOffParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .powerOff( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + virtualMachinePowerOffParameters, + accept, + context); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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> beginPowerOffAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters) { + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginPowerOffAsync(String resourceGroupName, String virtualMachineName) { + final VirtualMachinePowerOffParameters virtualMachinePowerOffParameters = null; + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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> beginPowerOffAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + powerOffWithResponseAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginPowerOff(String resourceGroupName, String virtualMachineName) { + final VirtualMachinePowerOffParameters virtualMachinePowerOffParameters = null; + return this + .beginPowerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters) + .getSyncPoller(); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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> beginPowerOff( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context) { + return this + .beginPowerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters, context) + .getSyncPoller(); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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 powerOffAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters) { + return beginPowerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 powerOffAsync(String resourceGroupName, String virtualMachineName) { + final VirtualMachinePowerOffParameters virtualMachinePowerOffParameters = null; + return beginPowerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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 powerOffAsync( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context) { + return beginPowerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 powerOff(String resourceGroupName, String virtualMachineName) { + final VirtualMachinePowerOffParameters virtualMachinePowerOffParameters = null; + powerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters).block(); + } + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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 powerOff( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context) { + powerOffAsync(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters, context).block(); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> reimageWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> reimageWithResponseAsync( + String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginReimageAsync(String resourceGroupName, String virtualMachineName) { + Mono>> mono = reimageWithResponseAsync(resourceGroupName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginReimageAsync( + String resourceGroupName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginReimage(String resourceGroupName, String virtualMachineName) { + return this.beginReimageAsync(resourceGroupName, virtualMachineName).getSyncPoller(); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginReimage( + String resourceGroupName, String virtualMachineName, Context context) { + return this.beginReimageAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimageAsync(String resourceGroupName, String virtualMachineName) { + return beginReimageAsync(resourceGroupName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimageAsync(String resourceGroupName, String virtualMachineName, Context context) { + return beginReimageAsync(resourceGroupName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimage(String resourceGroupName, String virtualMachineName) { + reimageAsync(resourceGroupName, virtualMachineName).block(); + } + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimage(String resourceGroupName, String virtualMachineName, Context context) { + reimageAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> restartWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> restartWithResponseAsync( + String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginRestartAsync(String resourceGroupName, String virtualMachineName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginRestartAsync( + String resourceGroupName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginRestart(String resourceGroupName, String virtualMachineName) { + return this.beginRestartAsync(resourceGroupName, virtualMachineName).getSyncPoller(); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginRestart( + String resourceGroupName, String virtualMachineName, Context context) { + return this.beginRestartAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restartAsync(String resourceGroupName, String virtualMachineName) { + return beginRestartAsync(resourceGroupName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restartAsync(String resourceGroupName, String virtualMachineName, Context context) { + return beginRestartAsync(resourceGroupName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restart(String resourceGroupName, String virtualMachineName) { + restartAsync(resourceGroupName, virtualMachineName).block(); + } + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restart(String resourceGroupName, String virtualMachineName, Context context) { + restartAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> startWithResponseAsync( + String resourceGroupName, String virtualMachineName) { + 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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>> startWithResponseAsync( + String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + virtualMachineName, + accept, + context); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginStartAsync(String resourceGroupName, String virtualMachineName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, virtualMachineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginStartAsync( + String resourceGroupName, String virtualMachineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, virtualMachineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginStart(String resourceGroupName, String virtualMachineName) { + return this.beginStartAsync(resourceGroupName, virtualMachineName).getSyncPoller(); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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> beginStart( + String resourceGroupName, String virtualMachineName, Context context) { + return this.beginStartAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 startAsync(String resourceGroupName, String virtualMachineName) { + return beginStartAsync(resourceGroupName, virtualMachineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 startAsync(String resourceGroupName, String virtualMachineName, Context context) { + return beginStartAsync(resourceGroupName, virtualMachineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 start(String resourceGroupName, String virtualMachineName) { + startAsync(resourceGroupName, virtualMachineName).block(); + } + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 start(String resourceGroupName, String virtualMachineName, Context context) { + startAsync(resourceGroupName, virtualMachineName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 virtualMachineList represents a list of virtual machines along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java new file mode 100644 index 000000000000..a2dfa965d9be --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VirtualMachinesImpl.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner; +import com.azure.resourcemanager.networkcloud.models.VirtualMachine; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; +import com.azure.resourcemanager.networkcloud.models.VirtualMachines; + +public final class VirtualMachinesImpl implements VirtualMachines { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesImpl.class); + + private final VirtualMachinesClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public VirtualMachinesImpl( + VirtualMachinesClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VirtualMachineImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualMachineName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VirtualMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName) { + VirtualMachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineName); + if (inner != null) { + return new VirtualMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String virtualMachineName) { + this.serviceClient().delete(resourceGroupName, virtualMachineName); + } + + public void delete(String resourceGroupName, String virtualMachineName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualMachineName, context); + } + + public void attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters) { + this.serviceClient().attachVolume(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters); + } + + public void attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context) { + this + .serviceClient() + .attachVolume(resourceGroupName, virtualMachineName, virtualMachineAttachVolumeParameters, context); + } + + public void detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters) { + this.serviceClient().detachVolume(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters); + } + + public void detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context) { + this + .serviceClient() + .detachVolume(resourceGroupName, virtualMachineName, virtualMachineDetachVolumeParameters, context); + } + + public void powerOff(String resourceGroupName, String virtualMachineName) { + this.serviceClient().powerOff(resourceGroupName, virtualMachineName); + } + + public void powerOff( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context) { + this.serviceClient().powerOff(resourceGroupName, virtualMachineName, virtualMachinePowerOffParameters, context); + } + + public void reimage(String resourceGroupName, String virtualMachineName) { + this.serviceClient().reimage(resourceGroupName, virtualMachineName); + } + + public void reimage(String resourceGroupName, String virtualMachineName, Context context) { + this.serviceClient().reimage(resourceGroupName, virtualMachineName, context); + } + + public void restart(String resourceGroupName, String virtualMachineName) { + this.serviceClient().restart(resourceGroupName, virtualMachineName); + } + + public void restart(String resourceGroupName, String virtualMachineName, Context context) { + this.serviceClient().restart(resourceGroupName, virtualMachineName, context); + } + + public void start(String resourceGroupName, String virtualMachineName) { + this.serviceClient().start(resourceGroupName, virtualMachineName); + } + + public void start(String resourceGroupName, String virtualMachineName, Context context) { + this.serviceClient().start(resourceGroupName, virtualMachineName, context); + } + + public VirtualMachine getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + this.delete(resourceGroupName, virtualMachineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualMachineName = Utils.getValueFromIdByName(id, "virtualMachines"); + if (virtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); + } + this.delete(resourceGroupName, virtualMachineName, context); + } + + private VirtualMachinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public VirtualMachineImpl define(String name) { + return new VirtualMachineImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java new file mode 100644 index 000000000000..d913b2d7ce65 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumeImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.Volume; +import com.azure.resourcemanager.networkcloud.models.VolumeDetailedStatus; +import com.azure.resourcemanager.networkcloud.models.VolumePatchParameters; +import com.azure.resourcemanager.networkcloud.models.VolumeProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VolumeImpl implements Volume, Volume.Definition, Volume.Update { + private VolumeInner innerObject; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List attachedTo() { + List inner = this.innerModel().attachedTo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VolumeDetailedStatus detailedStatus() { + return this.innerModel().detailedStatus(); + } + + public String detailedStatusMessage() { + return this.innerModel().detailedStatusMessage(); + } + + public VolumeProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public long sizeMiB() { + return this.innerModel().sizeMiB(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public VolumeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String volumeName; + + private VolumePatchParameters updateVolumeUpdateParameters; + + public VolumeImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Volume create() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .createOrUpdate(resourceGroupName, volumeName, this.innerModel(), Context.NONE); + return this; + } + + public Volume create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .createOrUpdate(resourceGroupName, volumeName, this.innerModel(), context); + return this; + } + + VolumeImpl(String name, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = new VolumeInner(); + this.serviceManager = serviceManager; + this.volumeName = name; + } + + public VolumeImpl update() { + this.updateVolumeUpdateParameters = new VolumePatchParameters(); + return this; + } + + public Volume apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .updateWithResponse(resourceGroupName, volumeName, updateVolumeUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public Volume apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .updateWithResponse(resourceGroupName, volumeName, updateVolumeUpdateParameters, context) + .getValue(); + return this; + } + + VolumeImpl(VolumeInner innerObject, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.volumeName = Utils.getValueFromIdByName(innerObject.id(), "volumes"); + } + + public Volume refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getByResourceGroupWithResponse(resourceGroupName, volumeName, Context.NONE) + .getValue(); + return this; + } + + public Volume refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getByResourceGroupWithResponse(resourceGroupName, volumeName, context) + .getValue(); + return this; + } + + public VolumeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VolumeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VolumeImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public VolumeImpl withSizeMiB(long sizeMiB) { + this.innerModel().withSizeMiB(sizeMiB); + return this; + } + + public VolumeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateVolumeUpdateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java new file mode 100644 index 000000000000..e1b6a8a33892 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesClientImpl.java @@ -0,0 +1,1514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.networkcloud.fluent.VolumesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; +import com.azure.resourcemanager.networkcloud.models.VolumeList; +import com.azure.resourcemanager.networkcloud.models.VolumePatchParameters; +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 VolumesClient. */ +public final class VolumesClientImpl implements VolumesClient { + /** The proxy service used to perform REST calls. */ + private final VolumesService service; + + /** The service client containing this operation class. */ + private final NetworkCloudImpl client; + + /** + * Initializes an instance of VolumesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VolumesClientImpl(NetworkCloudImpl client) { + this.service = RestProxy.create(VolumesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkCloudVolumes to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkCloudVolumes") + public interface VolumesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("volumeName") String volumeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("volumeName") String volumeName, + @BodyParam("application/json") VolumeInner volumeParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("volumeName") String volumeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("volumeName") String volumeName, + @BodyParam("application/json") VolumePatchParameters volumeUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 list of volumes in the provided subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 list of volumes in the provided subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 list of volumes in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 list of volumes in the provided subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 list of volumes in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 list of volumes in the provided subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of volumes in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of volumes in the provided resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of volumes in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of volumes in the provided resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of volumes in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of volumes in the provided resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String volumeName) { + 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String volumeName, 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + accept, + context); + } + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String volumeName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, volumeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String volumeName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, volumeName, context).block(); + } + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner getByResourceGroup(String resourceGroupName, String volumeName) { + return getByResourceGroupWithResponse(resourceGroupName, volumeName, Context.NONE).getValue(); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String volumeName, VolumeInner volumeParameters) { + 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (volumeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeParameters is required and cannot be null.")); + } else { + volumeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + volumeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (volumeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeParameters is required and cannot be null.")); + } else { + volumeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + volumeParameters, + accept, + context); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources + * running on the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String volumeName, VolumeInner volumeParameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, volumeName, volumeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, this.client.getContext()); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources + * running on the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, volumeName, volumeParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, context); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources + * running on the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, String volumeName, VolumeInner volumeParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, volumeName, volumeParameters).getSyncPoller(); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources + * running on the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeInner> beginCreateOrUpdate( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, volumeName, volumeParameters, context).getSyncPoller(); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String volumeName, VolumeInner volumeParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, volumeName, volumeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, volumeName, volumeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner createOrUpdate(String resourceGroupName, String volumeName, VolumeInner volumeParameters) { + return createOrUpdateAsync(resourceGroupName, volumeName, volumeParameters).block(); + } + + /** + * Create or update the volume. + * + *

Create a new volume or update the properties of the existing one. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner createOrUpdate( + String resourceGroupName, String volumeName, VolumeInner volumeParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, volumeName, volumeParameters, context).block(); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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>> deleteWithResponseAsync(String resourceGroupName, String volumeName) { + 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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>> deleteWithResponseAsync( + String resourceGroupName, String volumeName, 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + accept, + context); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, volumeName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, volumeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName) { + return this.beginDeleteAsync(resourceGroupName, volumeName).getSyncPoller(); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName, Context context) { + return this.beginDeleteAsync(resourceGroupName, volumeName, context).getSyncPoller(); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName) { + return beginDeleteAsync(resourceGroupName, volumeName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volumeName, Context context) { + return beginDeleteAsync(resourceGroupName, volumeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 delete(String resourceGroupName, String volumeName) { + deleteAsync(resourceGroupName, volumeName).block(); + } + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 delete(String resourceGroupName, String volumeName, Context context) { + deleteAsync(resourceGroupName, volumeName, context).block(); + } + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeUpdateParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String volumeName, VolumePatchParameters volumeUpdateParameters) { + 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (volumeUpdateParameters != null) { + volumeUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + volumeUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeUpdateParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String volumeName, VolumePatchParameters volumeUpdateParameters, 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 (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + if (volumeUpdateParameters != null) { + volumeUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + volumeName, + volumeUpdateParameters, + accept, + context); + } + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volume represents storage made available for use by resources running on the cluster on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String volumeName) { + final VolumePatchParameters volumeUpdateParameters = null; + return updateWithResponseAsync(resourceGroupName, volumeName, volumeUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @param volumeUpdateParameters The request body. + * @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 volume represents storage made available for use by resources running on the cluster along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String volumeName, VolumePatchParameters volumeUpdateParameters, Context context) { + return updateWithResponseAsync(resourceGroupName, volumeName, volumeUpdateParameters, context).block(); + } + + /** + * Patch the volume. + * + *

Update tags associated with the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 volume represents storage made available for use by resources running on the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner update(String resourceGroupName, String volumeName) { + final VolumePatchParameters volumeUpdateParameters = null; + return updateWithResponse(resourceGroupName, volumeName, volumeUpdateParameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @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 volumeList represents a list of volumes along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java new file mode 100644 index 000000000000..61a688ada669 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/VolumesImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.networkcloud.fluent.VolumesClient; +import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; +import com.azure.resourcemanager.networkcloud.models.Volume; +import com.azure.resourcemanager.networkcloud.models.Volumes; + +public final class VolumesImpl implements Volumes { + private static final ClientLogger LOGGER = new ClientLogger(VolumesImpl.class); + + private final VolumesClient innerClient; + + private final com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager; + + public VolumesImpl( + VolumesClient innerClient, com.azure.resourcemanager.networkcloud.NetworkCloudManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String volumeName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, volumeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VolumeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Volume getByResourceGroup(String resourceGroupName, String volumeName) { + VolumeInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, volumeName); + if (inner != null) { + return new VolumeImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String volumeName) { + this.serviceClient().delete(resourceGroupName, volumeName); + } + + public void delete(String resourceGroupName, String volumeName, Context context) { + this.serviceClient().delete(resourceGroupName, volumeName, context); + } + + public Volume getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, volumeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, volumeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.delete(resourceGroupName, volumeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.delete(resourceGroupName, volumeName, context); + } + + private VolumesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.networkcloud.NetworkCloudManager manager() { + return this.serviceManager; + } + + public VolumeImpl define(String name) { + return new VolumeImpl(name, this.manager()); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java new file mode 100644 index 000000000000..59b7f3fc4c13 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for NetworkCloud. The Network Cloud APIs provide management of the on-premises + * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + */ +package com.azure.resourcemanager.networkcloud.implementation; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java new file mode 100644 index 000000000000..13c937d5902b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java new file mode 100644 index 000000000000..26885f852c1c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/AdministrativeCredentials.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AdministrativeCredentials represents the admin credentials for the device requiring password-based authentication. + */ +@Fluent +public final class AdministrativeCredentials { + /* + * The password of the administrator of the device used during initialization. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /* + * The username of the administrator of the device used during initialization. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** Creates an instance of AdministrativeCredentials class. */ + public AdministrativeCredentials() { + } + + /** + * Get the password property: The password of the administrator of the device used during initialization. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the administrator of the device used during initialization. + * + * @param password the password value to set. + * @return the AdministrativeCredentials object itself. + */ + public AdministrativeCredentials withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the username property: The username of the administrator of the device used during initialization. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username of the administrator of the device used during initialization. + * + * @param username the username value to set. + * @return the AdministrativeCredentials object itself. + */ + public AdministrativeCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model AdministrativeCredentials")); + } + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model AdministrativeCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdministrativeCredentials.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java new file mode 100644 index 000000000000..7afd3a8f3a3d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachine.java @@ -0,0 +1,842 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BareMetalMachine. */ +public interface BareMetalMachine { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the bmcConnectionString property: The connection string for the baseboard management controller including IP + * address and protocol. + * + * @return the bmcConnectionString value. + */ + String bmcConnectionString(); + + /** + * Gets the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @return the bmcCredentials value. + */ + AdministrativeCredentials bmcCredentials(); + + /** + * Gets the bmcMacAddress property: The MAC address of the BMC device. + * + * @return the bmcMacAddress value. + */ + String bmcMacAddress(); + + /** + * Gets the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @return the bootMacAddress value. + */ + String bootMacAddress(); + + /** + * Gets the clusterId property: The resource ID of the cluster this bare metal machine is associated with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the cordonStatus property: The cordon status of the bare metal machine. + * + * @return the cordonStatus value. + */ + BareMetalMachineCordonStatus cordonStatus(); + + /** + * Gets the detailedStatus property: The more detailed status of the bare metal machine. + * + * @return the detailedStatus value. + */ + BareMetalMachineDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the hardwareInventory property: HardwareInventory represents the hardware configuration of this machine as + * exposed to the customer, including information acquired from the model/sku information and from the ironic + * inspector. + * + *

The hardware inventory, including information acquired from the model/sku information and from the ironic + * inspector. + * + * @return the hardwareInventory value. + */ + HardwareInventory hardwareInventory(); + + /** + * Gets the hardwareValidationStatus property: HardwareValidationStatus represents the latest hardware validation + * details performed for this bare metal machine. + * + *

The details of the latest hardware validation performed for this bare metal machine. + * + * @return the hardwareValidationStatus value. + */ + HardwareValidationStatus hardwareValidationStatus(); + + /** + * Gets the hybridAksClustersAssociatedIds property: The list of the resource IDs for the HybridAksClusters that + * have nodes hosted on this bare metal machine. + * + * @return the hybridAksClustersAssociatedIds value. + */ + List hybridAksClustersAssociatedIds(); + + /** + * Gets the kubernetesNodeName property: The name of this machine represented by the host object in the Cluster's + * Kubernetes control plane. + * + * @return the kubernetesNodeName value. + */ + String kubernetesNodeName(); + + /** + * Gets the kubernetesVersion property: The version of Kubernetes running on this machine. + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the machineDetails property: The custom details provided by the customer. + * + * @return the machineDetails value. + */ + String machineDetails(); + + /** + * Gets the machineName property: The OS-level hostname assigned to this machine. + * + * @return the machineName value. + */ + String machineName(); + + /** + * Gets the machineSkuId property: The unique internal identifier of the bare metal machine SKU. + * + * @return the machineSkuId value. + */ + String machineSkuId(); + + /** + * Gets the oamIpv4Address property: The IPv4 address that is assigned to the bare metal machine during the cluster + * deployment. + * + * @return the oamIpv4Address value. + */ + String oamIpv4Address(); + + /** + * Gets the oamIpv6Address property: The IPv6 address that is assigned to the bare metal machine during the cluster + * deployment. + * + * @return the oamIpv6Address value. + */ + String oamIpv6Address(); + + /** + * Gets the osImage property: The image that is currently provisioned to the OS disk. + * + * @return the osImage value. + */ + String osImage(); + + /** + * Gets the powerState property: The power state derived from the baseboard management controller. + * + * @return the powerState value. + */ + BareMetalMachinePowerState powerState(); + + /** + * Gets the provisioningState property: The provisioning state of the bare metal machine. + * + * @return the provisioningState value. + */ + BareMetalMachineProvisioningState provisioningState(); + + /** + * Gets the rackId property: The resource ID of the rack where this bare metal machine resides. + * + * @return the rackId value. + */ + String rackId(); + + /** + * Gets the rackSlot property: The rack slot in which this bare metal machine is located, ordered from the bottom up + * i.e. the lowest slot is 1. + * + * @return the rackSlot value. + */ + long rackSlot(); + + /** + * Gets the readyState property: The indicator of whether the bare metal machine is ready to receive workloads. + * + * @return the readyState value. + */ + BareMetalMachineReadyState readyState(); + + /** + * Gets the serialNumber property: The serial number of the bare metal machine. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the serviceTag property: The discovered value of the machine's service tag. + * + * @return the serviceTag value. + */ + String serviceTag(); + + /** + * Gets the virtualMachinesAssociatedIds property: The list of the resource IDs for the VirtualMachines that are + * hosted on this bare metal machine. + * + * @return the virtualMachinesAssociatedIds value. + */ + List virtualMachinesAssociatedIds(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner object. + * + * @return the inner object. + */ + BareMetalMachineInner innerModel(); + + /** The entirety of the BareMetalMachine definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithBmcConnectionString, + DefinitionStages.WithBmcCredentials, + DefinitionStages.WithBmcMacAddress, + DefinitionStages.WithBootMacAddress, + DefinitionStages.WithMachineDetails, + DefinitionStages.WithMachineName, + DefinitionStages.WithMachineSkuId, + DefinitionStages.WithRackId, + DefinitionStages.WithRackSlot, + DefinitionStages.WithSerialNumber, + DefinitionStages.WithCreate { + } + /** The BareMetalMachine definition stages. */ + interface DefinitionStages { + /** The first stage of the BareMetalMachine definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BareMetalMachine definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the BareMetalMachine definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the BareMetalMachine definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithBmcConnectionString withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the BareMetalMachine definition allowing to specify bmcConnectionString. */ + interface WithBmcConnectionString { + /** + * Specifies the bmcConnectionString property: The connection string for the baseboard management controller + * including IP address and protocol.. + * + * @param bmcConnectionString The connection string for the baseboard management controller including IP + * address and protocol. + * @return the next definition stage. + */ + WithBmcCredentials withBmcConnectionString(String bmcConnectionString); + } + /** The stage of the BareMetalMachine definition allowing to specify bmcCredentials. */ + interface WithBmcCredentials { + /** + * Specifies the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the + * device requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine.. + * + * @param bmcCredentials AdministrativeCredentials represents the admin credentials for the device requiring + * password-based authentication. + *

The credentials of the baseboard management controller on this bare metal machine. + * @return the next definition stage. + */ + WithBmcMacAddress withBmcCredentials(AdministrativeCredentials bmcCredentials); + } + /** The stage of the BareMetalMachine definition allowing to specify bmcMacAddress. */ + interface WithBmcMacAddress { + /** + * Specifies the bmcMacAddress property: The MAC address of the BMC device.. + * + * @param bmcMacAddress The MAC address of the BMC device. + * @return the next definition stage. + */ + WithBootMacAddress withBmcMacAddress(String bmcMacAddress); + } + /** The stage of the BareMetalMachine definition allowing to specify bootMacAddress. */ + interface WithBootMacAddress { + /** + * Specifies the bootMacAddress property: The MAC address of a NIC connected to the PXE network.. + * + * @param bootMacAddress The MAC address of a NIC connected to the PXE network. + * @return the next definition stage. + */ + WithMachineDetails withBootMacAddress(String bootMacAddress); + } + /** The stage of the BareMetalMachine definition allowing to specify machineDetails. */ + interface WithMachineDetails { + /** + * Specifies the machineDetails property: The custom details provided by the customer.. + * + * @param machineDetails The custom details provided by the customer. + * @return the next definition stage. + */ + WithMachineName withMachineDetails(String machineDetails); + } + /** The stage of the BareMetalMachine definition allowing to specify machineName. */ + interface WithMachineName { + /** + * Specifies the machineName property: The OS-level hostname assigned to this machine.. + * + * @param machineName The OS-level hostname assigned to this machine. + * @return the next definition stage. + */ + WithMachineSkuId withMachineName(String machineName); + } + /** The stage of the BareMetalMachine definition allowing to specify machineSkuId. */ + interface WithMachineSkuId { + /** + * Specifies the machineSkuId property: The unique internal identifier of the bare metal machine SKU.. + * + * @param machineSkuId The unique internal identifier of the bare metal machine SKU. + * @return the next definition stage. + */ + WithRackId withMachineSkuId(String machineSkuId); + } + /** The stage of the BareMetalMachine definition allowing to specify rackId. */ + interface WithRackId { + /** + * Specifies the rackId property: The resource ID of the rack where this bare metal machine resides.. + * + * @param rackId The resource ID of the rack where this bare metal machine resides. + * @return the next definition stage. + */ + WithRackSlot withRackId(String rackId); + } + /** The stage of the BareMetalMachine definition allowing to specify rackSlot. */ + interface WithRackSlot { + /** + * Specifies the rackSlot property: The rack slot in which this bare metal machine is located, ordered from + * the bottom up i.e. the lowest slot is 1.. + * + * @param rackSlot The rack slot in which this bare metal machine is located, ordered from the bottom up + * i.e. the lowest slot is 1. + * @return the next definition stage. + */ + WithSerialNumber withRackSlot(long rackSlot); + } + /** The stage of the BareMetalMachine definition allowing to specify serialNumber. */ + interface WithSerialNumber { + /** + * Specifies the serialNumber property: The serial number of the bare metal machine.. + * + * @param serialNumber The serial number of the bare metal machine. + * @return the next definition stage. + */ + WithCreate withSerialNumber(String serialNumber); + } + /** + * The stage of the BareMetalMachine 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.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + BareMetalMachine create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BareMetalMachine create(Context context); + } + /** The stage of the BareMetalMachine definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the BareMetalMachine resource. + * + * @return the stage of resource update. + */ + BareMetalMachine.Update update(); + + /** The template for BareMetalMachine update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithMachineDetails { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BareMetalMachine apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BareMetalMachine apply(Context context); + } + /** The BareMetalMachine update stages. */ + interface UpdateStages { + /** The stage of the BareMetalMachine update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the BareMetalMachine update allowing to specify machineDetails. */ + interface WithMachineDetails { + /** + * Specifies the machineDetails property: The details provided by the customer during the creation of rack + * manifests that allows for custom data to be associated with this machine.. + * + * @param machineDetails The details provided by the customer during the creation of rack manifests that + * allows for custom data to be associated with this machine. + * @return the next definition stage. + */ + Update withMachineDetails(String machineDetails); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BareMetalMachine refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BareMetalMachine refresh(Context context); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @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 cordon(); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param bareMetalMachineCordonParameters The request body. + * @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 cordon(BareMetalMachineCordonParameters bareMetalMachineCordonParameters, Context context); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @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 powerOff(); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param bareMetalMachinePowerOffParameters The request body. + * @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 powerOff(BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, Context context); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @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 reimage(); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @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 reimage(Context context); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @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 replace(); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param bareMetalMachineReplaceParameters The request body. + * @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 replace(BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, Context context); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @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 restart(); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @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 restart(Context context); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand(BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand(BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, Context context); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts(BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, Context context); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands(BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, Context context); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @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 start(); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @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 start(Context context); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @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 uncordon(); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @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 uncordon(Context context); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware(BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.java new file mode 100644 index 000000000000..dcdc1ab34ae2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCommandSpecification.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.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * BareMetalMachineCommandSpecification represents the command and optional arguments to exercise against the bare metal + * machine. + */ +@Fluent +public final class BareMetalMachineCommandSpecification { + /* + * The list of string arguments that will be passed to the script in order as separate arguments. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * The command to execute against the bare metal machine. + */ + @JsonProperty(value = "command", required = true) + private String command; + + /** Creates an instance of BareMetalMachineCommandSpecification class. */ + public BareMetalMachineCommandSpecification() { + } + + /** + * Get the arguments property: The list of string arguments that will be passed to the script in order as separate + * arguments. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The list of string arguments that will be passed to the script in order as separate + * arguments. + * + * @param arguments the arguments value to set. + * @return the BareMetalMachineCommandSpecification object itself. + */ + public BareMetalMachineCommandSpecification withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the command property: The command to execute against the bare metal machine. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command to execute against the bare metal machine. + * + * @param command the command value to set. + * @return the BareMetalMachineCommandSpecification object itself. + */ + public BareMetalMachineCommandSpecification withCommand(String command) { + this.command = command; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (command() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property command in model BareMetalMachineCommandSpecification")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineCommandSpecification.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java new file mode 100644 index 000000000000..6eefdb761348 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineConfigurationData.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BareMetalMachineConfigurationData represents configuration for the bare metal machine. */ +@Fluent +public final class BareMetalMachineConfigurationData { + /* + * The connection string for the baseboard management controller including IP address and protocol. + */ + @JsonProperty(value = "bmcConnectionString", access = JsonProperty.Access.WRITE_ONLY) + private String bmcConnectionString; + + /* + * AdministrativeCredentials represents the admin credentials for the device requiring password-based + * authentication. + * + * The credentials of the baseboard management controller on this bare metal machine. + */ + @JsonProperty(value = "bmcCredentials", required = true) + private AdministrativeCredentials bmcCredentials; + + /* + * The MAC address of the BMC for this machine. + */ + @JsonProperty(value = "bmcMacAddress", required = true) + private String bmcMacAddress; + + /* + * The MAC address associated with the PXE NIC card. + */ + @JsonProperty(value = "bootMacAddress", required = true) + private String bootMacAddress; + + /* + * The free-form additional information about the machine, e.g. an asset tag. + */ + @JsonProperty(value = "machineDetails") + private String machineDetails; + + /* + * The user-provided name for the bare metal machine created from this specification. + * If not provided, the machine name will be generated programmatically. + */ + @JsonProperty(value = "machineName") + private String machineName; + + /* + * The slot the physical machine is in the rack based on the BOM configuration. + */ + @JsonProperty(value = "rackSlot", required = true) + private long rackSlot; + + /* + * The serial number of the machine. Hardware suppliers may use an alternate value. For example, service tag. + */ + @JsonProperty(value = "serialNumber", required = true) + private String serialNumber; + + /** Creates an instance of BareMetalMachineConfigurationData class. */ + public BareMetalMachineConfigurationData() { + } + + /** + * Get the bmcConnectionString property: The connection string for the baseboard management controller including IP + * address and protocol. + * + * @return the bmcConnectionString value. + */ + public String bmcConnectionString() { + return this.bmcConnectionString; + } + + /** + * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @return the bmcCredentials value. + */ + public AdministrativeCredentials bmcCredentials() { + return this.bmcCredentials; + } + + /** + * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @param bmcCredentials the bmcCredentials value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withBmcCredentials(AdministrativeCredentials bmcCredentials) { + this.bmcCredentials = bmcCredentials; + return this; + } + + /** + * Get the bmcMacAddress property: The MAC address of the BMC for this machine. + * + * @return the bmcMacAddress value. + */ + public String bmcMacAddress() { + return this.bmcMacAddress; + } + + /** + * Set the bmcMacAddress property: The MAC address of the BMC for this machine. + * + * @param bmcMacAddress the bmcMacAddress value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withBmcMacAddress(String bmcMacAddress) { + this.bmcMacAddress = bmcMacAddress; + return this; + } + + /** + * Get the bootMacAddress property: The MAC address associated with the PXE NIC card. + * + * @return the bootMacAddress value. + */ + public String bootMacAddress() { + return this.bootMacAddress; + } + + /** + * Set the bootMacAddress property: The MAC address associated with the PXE NIC card. + * + * @param bootMacAddress the bootMacAddress value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withBootMacAddress(String bootMacAddress) { + this.bootMacAddress = bootMacAddress; + return this; + } + + /** + * Get the machineDetails property: The free-form additional information about the machine, e.g. an asset tag. + * + * @return the machineDetails value. + */ + public String machineDetails() { + return this.machineDetails; + } + + /** + * Set the machineDetails property: The free-form additional information about the machine, e.g. an asset tag. + * + * @param machineDetails the machineDetails value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withMachineDetails(String machineDetails) { + this.machineDetails = machineDetails; + return this; + } + + /** + * Get the machineName property: The user-provided name for the bare metal machine created from this specification. + * If not provided, the machine name will be generated programmatically. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Set the machineName property: The user-provided name for the bare metal machine created from this specification. + * If not provided, the machine name will be generated programmatically. + * + * @param machineName the machineName value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withMachineName(String machineName) { + this.machineName = machineName; + return this; + } + + /** + * Get the rackSlot property: The slot the physical machine is in the rack based on the BOM configuration. + * + * @return the rackSlot value. + */ + public long rackSlot() { + return this.rackSlot; + } + + /** + * Set the rackSlot property: The slot the physical machine is in the rack based on the BOM configuration. + * + * @param rackSlot the rackSlot value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withRackSlot(long rackSlot) { + this.rackSlot = rackSlot; + return this; + } + + /** + * Get the serialNumber property: The serial number of the machine. Hardware suppliers may use an alternate value. + * For example, service tag. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number of the machine. Hardware suppliers may use an alternate value. + * For example, service tag. + * + * @param serialNumber the serialNumber value to set. + * @return the BareMetalMachineConfigurationData object itself. + */ + public BareMetalMachineConfigurationData withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bmcCredentials() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bmcCredentials in model BareMetalMachineConfigurationData")); + } else { + bmcCredentials().validate(); + } + if (bmcMacAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bmcMacAddress in model BareMetalMachineConfigurationData")); + } + if (bootMacAddress() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bootMacAddress in model BareMetalMachineConfigurationData")); + } + if (serialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serialNumber in model BareMetalMachineConfigurationData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineConfigurationData.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java new file mode 100644 index 000000000000..02249eaf0d89 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonParameters.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal + * machine. + */ +@Fluent +public final class BareMetalMachineCordonParameters { + /* + * The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. + */ + @JsonProperty(value = "evacuate") + private BareMetalMachineEvacuate evacuate; + + /** Creates an instance of BareMetalMachineCordonParameters class. */ + public BareMetalMachineCordonParameters() { + } + + /** + * Get the evacuate property: The indicator of whether to evacuate the node workload when the bare metal machine is + * cordoned. + * + * @return the evacuate value. + */ + public BareMetalMachineEvacuate evacuate() { + return this.evacuate; + } + + /** + * Set the evacuate property: The indicator of whether to evacuate the node workload when the bare metal machine is + * cordoned. + * + * @param evacuate the evacuate value to set. + * @return the BareMetalMachineCordonParameters object itself. + */ + public BareMetalMachineCordonParameters withEvacuate(BareMetalMachineEvacuate evacuate) { + this.evacuate = evacuate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.java new file mode 100644 index 000000000000..ba47f83edf6c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineCordonStatus.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The cordon status of the bare metal machine. */ +public final class BareMetalMachineCordonStatus extends ExpandableStringEnum { + /** Static value Cordoned for BareMetalMachineCordonStatus. */ + public static final BareMetalMachineCordonStatus CORDONED = fromString("Cordoned"); + + /** Static value Uncordoned for BareMetalMachineCordonStatus. */ + public static final BareMetalMachineCordonStatus UNCORDONED = fromString("Uncordoned"); + + /** + * Creates a new instance of BareMetalMachineCordonStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineCordonStatus() { + } + + /** + * Creates or finds a BareMetalMachineCordonStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineCordonStatus. + */ + @JsonCreator + public static BareMetalMachineCordonStatus fromString(String name) { + return fromString(name, BareMetalMachineCordonStatus.class); + } + + /** + * Gets known BareMetalMachineCordonStatus values. + * + * @return known BareMetalMachineCordonStatus values. + */ + public static Collection values() { + return values(BareMetalMachineCordonStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java new file mode 100644 index 000000000000..7946539c2a4c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineDetailedStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the bare metal machine. */ +public final class BareMetalMachineDetailedStatus extends ExpandableStringEnum { + /** Static value Preparing for BareMetalMachineDetailedStatus. */ + public static final BareMetalMachineDetailedStatus PREPARING = fromString("Preparing"); + + /** Static value Error for BareMetalMachineDetailedStatus. */ + public static final BareMetalMachineDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for BareMetalMachineDetailedStatus. */ + public static final BareMetalMachineDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for BareMetalMachineDetailedStatus. */ + public static final BareMetalMachineDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for BareMetalMachineDetailedStatus. */ + public static final BareMetalMachineDetailedStatus PROVISIONED = fromString("Provisioned"); + + /** Static value Deprovisioning for BareMetalMachineDetailedStatus. */ + public static final BareMetalMachineDetailedStatus DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Creates a new instance of BareMetalMachineDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineDetailedStatus() { + } + + /** + * Creates or finds a BareMetalMachineDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineDetailedStatus. + */ + @JsonCreator + public static BareMetalMachineDetailedStatus fromString(String name) { + return fromString(name, BareMetalMachineDetailedStatus.class); + } + + /** + * Gets known BareMetalMachineDetailedStatus values. + * + * @return known BareMetalMachineDetailedStatus values. + */ + public static Collection values() { + return values(BareMetalMachineDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.java new file mode 100644 index 000000000000..a147cbddce18 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineEvacuate.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. */ +public final class BareMetalMachineEvacuate extends ExpandableStringEnum { + /** Static value True for BareMetalMachineEvacuate. */ + public static final BareMetalMachineEvacuate TRUE = fromString("True"); + + /** Static value False for BareMetalMachineEvacuate. */ + public static final BareMetalMachineEvacuate FALSE = fromString("False"); + + /** + * Creates a new instance of BareMetalMachineEvacuate value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineEvacuate() { + } + + /** + * Creates or finds a BareMetalMachineEvacuate from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineEvacuate. + */ + @JsonCreator + public static BareMetalMachineEvacuate fromString(String name) { + return fromString(name, BareMetalMachineEvacuate.class); + } + + /** + * Gets known BareMetalMachineEvacuate values. + * + * @return known BareMetalMachineEvacuate values. + */ + public static Collection values() { + return values(BareMetalMachineEvacuate.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationCategory.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationCategory.java new file mode 100644 index 000000000000..0608f52c0c40 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationCategory.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The category of hardware validation to perform. */ +public final class BareMetalMachineHardwareValidationCategory + extends ExpandableStringEnum { + /** Static value BasicValidation for BareMetalMachineHardwareValidationCategory. */ + public static final BareMetalMachineHardwareValidationCategory BASIC_VALIDATION = fromString("BasicValidation"); + + /** + * Creates a new instance of BareMetalMachineHardwareValidationCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineHardwareValidationCategory() { + } + + /** + * Creates or finds a BareMetalMachineHardwareValidationCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineHardwareValidationCategory. + */ + @JsonCreator + public static BareMetalMachineHardwareValidationCategory fromString(String name) { + return fromString(name, BareMetalMachineHardwareValidationCategory.class); + } + + /** + * Gets known BareMetalMachineHardwareValidationCategory values. + * + * @return known BareMetalMachineHardwareValidationCategory values. + */ + public static Collection values() { + return values(BareMetalMachineHardwareValidationCategory.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java new file mode 100644 index 000000000000..793edda4d041 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineHardwareValidationResult.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The outcome of the hardware validation. */ +public final class BareMetalMachineHardwareValidationResult + extends ExpandableStringEnum { + /** Static value Pass for BareMetalMachineHardwareValidationResult. */ + public static final BareMetalMachineHardwareValidationResult PASS = fromString("Pass"); + + /** Static value Fail for BareMetalMachineHardwareValidationResult. */ + public static final BareMetalMachineHardwareValidationResult FAIL = fromString("Fail"); + + /** + * Creates a new instance of BareMetalMachineHardwareValidationResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineHardwareValidationResult() { + } + + /** + * Creates or finds a BareMetalMachineHardwareValidationResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineHardwareValidationResult. + */ + @JsonCreator + public static BareMetalMachineHardwareValidationResult fromString(String name) { + return fromString(name, BareMetalMachineHardwareValidationResult.class); + } + + /** + * Gets known BareMetalMachineHardwareValidationResult values. + * + * @return known BareMetalMachineHardwareValidationResult values. + */ + public static Collection values() { + return values(BareMetalMachineHardwareValidationResult.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java new file mode 100644 index 000000000000..81c639db31a6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySet.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BareMetalMachineKeySet. */ +public interface BareMetalMachineKeySet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @return the azureGroupId value. + */ + String azureGroupId(); + + /** + * Gets the detailedStatus property: The more detailed status of the key set. + * + * @return the detailedStatus value. + */ + BareMetalMachineKeySetDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @return the expiration value. + */ + OffsetDateTime expiration(); + + /** + * Gets the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @return the jumpHostsAllowed value. + */ + List jumpHostsAllowed(); + + /** + * Gets the lastValidation property: The last time this key set was validated. + * + * @return the lastValidation value. + */ + OffsetDateTime lastValidation(); + + /** + * Gets the osGroupName property: The name of the group that users will be assigned to on the operating system of + * the machines. + * + * @return the osGroupName value. + */ + String osGroupName(); + + /** + * Gets the privilegeLevel property: The access level allowed for the users in this key set. + * + * @return the privilegeLevel value. + */ + BareMetalMachineKeySetPrivilegeLevel privilegeLevel(); + + /** + * Gets the provisioningState property: The provisioning state of the bare metal machine key set. + * + * @return the provisioningState value. + */ + BareMetalMachineKeySetProvisioningState provisioningState(); + + /** + * Gets the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + List userList(); + + /** + * Gets the userListStatus property: The status evaluation of each user. + * + * @return the userListStatus value. + */ + List userListStatus(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner object. + * + * @return the inner object. + */ + BareMetalMachineKeySetInner innerModel(); + + /** The entirety of the BareMetalMachineKeySet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAzureGroupId, + DefinitionStages.WithExpiration, + DefinitionStages.WithJumpHostsAllowed, + DefinitionStages.WithPrivilegeLevel, + DefinitionStages.WithUserList, + DefinitionStages.WithCreate { + } + /** The BareMetalMachineKeySet definition stages. */ + interface DefinitionStages { + /** The first stage of the BareMetalMachineKeySet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithExtendedLocation withExistingCluster(String resourceGroupName, String clusterName); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithAzureGroupId withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify azureGroupId. */ + interface WithAzureGroupId { + /** + * Specifies the azureGroupId property: The object ID of Azure Active Directory group that all users in the + * list must be in for access to be granted. Users that are not in the group will not have access.. + * + * @param azureGroupId The object ID of Azure Active Directory group that all users in the list must be in + * for access to be granted. Users that are not in the group will not have access. + * @return the next definition stage. + */ + WithExpiration withAzureGroupId(String azureGroupId); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify expiration. */ + interface WithExpiration { + /** + * Specifies the expiration property: The date and time after which the users in this key set will be + * removed from the bare metal machines.. + * + * @param expiration The date and time after which the users in this key set will be removed from the bare + * metal machines. + * @return the next definition stage. + */ + WithJumpHostsAllowed withExpiration(OffsetDateTime expiration); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify jumpHostsAllowed. */ + interface WithJumpHostsAllowed { + /** + * Specifies the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network + * access from which a login will be allowed for the users.. + * + * @param jumpHostsAllowed The list of IP addresses of jump hosts with management network access from which + * a login will be allowed for the users. + * @return the next definition stage. + */ + WithPrivilegeLevel withJumpHostsAllowed(List jumpHostsAllowed); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify privilegeLevel. */ + interface WithPrivilegeLevel { + /** + * Specifies the privilegeLevel property: The access level allowed for the users in this key set.. + * + * @param privilegeLevel The access level allowed for the users in this key set. + * @return the next definition stage. + */ + WithUserList withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel privilegeLevel); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify userList. */ + interface WithUserList { + /** + * Specifies the userList property: The unique list of permitted users.. + * + * @param userList The unique list of permitted users. + * @return the next definition stage. + */ + WithCreate withUserList(List userList); + } + /** + * The stage of the BareMetalMachineKeySet 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.WithTags, DefinitionStages.WithOsGroupName { + /** + * Executes the create request. + * + * @return the created resource. + */ + BareMetalMachineKeySet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BareMetalMachineKeySet create(Context context); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the BareMetalMachineKeySet definition allowing to specify osGroupName. */ + interface WithOsGroupName { + /** + * Specifies the osGroupName property: The name of the group that users will be assigned to on the operating + * system of the machines.. + * + * @param osGroupName The name of the group that users will be assigned to on the operating system of the + * machines. + * @return the next definition stage. + */ + WithCreate withOsGroupName(String osGroupName); + } + } + /** + * Begins update for the BareMetalMachineKeySet resource. + * + * @return the stage of resource update. + */ + BareMetalMachineKeySet.Update update(); + + /** The template for BareMetalMachineKeySet update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithExpiration, + UpdateStages.WithJumpHostsAllowed, + UpdateStages.WithUserList { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BareMetalMachineKeySet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BareMetalMachineKeySet apply(Context context); + } + /** The BareMetalMachineKeySet update stages. */ + interface UpdateStages { + /** The stage of the BareMetalMachineKeySet update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the BareMetalMachineKeySet update allowing to specify expiration. */ + interface WithExpiration { + /** + * Specifies the expiration property: The date and time after which the users in this key set will be + * removed from the bare metal machines.. + * + * @param expiration The date and time after which the users in this key set will be removed from the bare + * metal machines. + * @return the next definition stage. + */ + Update withExpiration(OffsetDateTime expiration); + } + /** The stage of the BareMetalMachineKeySet update allowing to specify jumpHostsAllowed. */ + interface WithJumpHostsAllowed { + /** + * Specifies the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network + * access from which a login will be allowed for the users.. + * + * @param jumpHostsAllowed The list of IP addresses of jump hosts with management network access from which + * a login will be allowed for the users. + * @return the next definition stage. + */ + Update withJumpHostsAllowed(List jumpHostsAllowed); + } + /** The stage of the BareMetalMachineKeySet update allowing to specify userList. */ + interface WithUserList { + /** + * Specifies the userList property: The unique list of permitted users.. + * + * @param userList The unique list of permitted users. + * @return the next definition stage. + */ + Update withUserList(List userList); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BareMetalMachineKeySet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BareMetalMachineKeySet refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java new file mode 100644 index 000000000000..ceb46be6531a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetDetailedStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the key set. */ +public final class BareMetalMachineKeySetDetailedStatus + extends ExpandableStringEnum { + /** Static value AllActive for BareMetalMachineKeySetDetailedStatus. */ + public static final BareMetalMachineKeySetDetailedStatus ALL_ACTIVE = fromString("AllActive"); + + /** Static value SomeInvalid for BareMetalMachineKeySetDetailedStatus. */ + public static final BareMetalMachineKeySetDetailedStatus SOME_INVALID = fromString("SomeInvalid"); + + /** Static value AllInvalid for BareMetalMachineKeySetDetailedStatus. */ + public static final BareMetalMachineKeySetDetailedStatus ALL_INVALID = fromString("AllInvalid"); + + /** Static value Validating for BareMetalMachineKeySetDetailedStatus. */ + public static final BareMetalMachineKeySetDetailedStatus VALIDATING = fromString("Validating"); + + /** + * Creates a new instance of BareMetalMachineKeySetDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineKeySetDetailedStatus() { + } + + /** + * Creates or finds a BareMetalMachineKeySetDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineKeySetDetailedStatus. + */ + @JsonCreator + public static BareMetalMachineKeySetDetailedStatus fromString(String name) { + return fromString(name, BareMetalMachineKeySetDetailedStatus.class); + } + + /** + * Gets known BareMetalMachineKeySetDetailedStatus values. + * + * @return known BareMetalMachineKeySetDetailedStatus values. + */ + public static Collection values() { + return values(BareMetalMachineKeySetDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java new file mode 100644 index 000000000000..d497b6d53cea --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BareMetalMachineKeySetList represents a list of bare metal machine key sets. */ +@Fluent +public final class BareMetalMachineKeySetList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of bare metal machine key sets. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of BareMetalMachineKeySetList class. */ + public BareMetalMachineKeySetList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the BareMetalMachineKeySetList object itself. + */ + public BareMetalMachineKeySetList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of bare metal machine key sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of bare metal machine key sets. + * + * @param value the value value to set. + * @return the BareMetalMachineKeySetList object itself. + */ + public BareMetalMachineKeySetList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java new file mode 100644 index 000000000000..d23bed6d155d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPatchParameters.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineKeySetPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. */ +@Fluent +public final class BareMetalMachineKeySetPatchParameters { + /* + * BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be + * patched. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private BareMetalMachineKeySetPatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of BareMetalMachineKeySetPatchParameters class. */ + public BareMetalMachineKeySetPatchParameters() { + } + + /** + * Get the innerProperties property: BareMetalMachineKeySetPatchProperties represents the properties of bare metal + * machine key set that can be patched. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private BareMetalMachineKeySetPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the BareMetalMachineKeySetPatchParameters object itself. + */ + public BareMetalMachineKeySetPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * bare metal machines. + * + * @param expiration the expiration value to set. + * @return the BareMetalMachineKeySetPatchParameters object itself. + */ + public BareMetalMachineKeySetPatchParameters withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetPatchProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Get the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @return the jumpHostsAllowed value. + */ + public List jumpHostsAllowed() { + return this.innerProperties() == null ? null : this.innerProperties().jumpHostsAllowed(); + } + + /** + * Set the jumpHostsAllowed property: The list of IP addresses of jump hosts with management network access from + * which a login will be allowed for the users. + * + * @param jumpHostsAllowed the jumpHostsAllowed value to set. + * @return the BareMetalMachineKeySetPatchParameters object itself. + */ + public BareMetalMachineKeySetPatchParameters withJumpHostsAllowed(List jumpHostsAllowed) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetPatchProperties(); + } + this.innerProperties().withJumpHostsAllowed(jumpHostsAllowed); + return this; + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.innerProperties() == null ? null : this.innerProperties().userList(); + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BareMetalMachineKeySetPatchParameters object itself. + */ + public BareMetalMachineKeySetPatchParameters withUserList(List userList) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachineKeySetPatchProperties(); + } + this.innerProperties().withUserList(userList); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java new file mode 100644 index 000000000000..e749bc11e931 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetPrivilegeLevel.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The access level allowed for the users in this key set. */ +public final class BareMetalMachineKeySetPrivilegeLevel + extends ExpandableStringEnum { + /** Static value Standard for BareMetalMachineKeySetPrivilegeLevel. */ + public static final BareMetalMachineKeySetPrivilegeLevel STANDARD = fromString("Standard"); + + /** Static value Superuser for BareMetalMachineKeySetPrivilegeLevel. */ + public static final BareMetalMachineKeySetPrivilegeLevel SUPERUSER = fromString("Superuser"); + + /** + * Creates a new instance of BareMetalMachineKeySetPrivilegeLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineKeySetPrivilegeLevel() { + } + + /** + * Creates or finds a BareMetalMachineKeySetPrivilegeLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineKeySetPrivilegeLevel. + */ + @JsonCreator + public static BareMetalMachineKeySetPrivilegeLevel fromString(String name) { + return fromString(name, BareMetalMachineKeySetPrivilegeLevel.class); + } + + /** + * Gets known BareMetalMachineKeySetPrivilegeLevel values. + * + * @return known BareMetalMachineKeySetPrivilegeLevel values. + */ + public static Collection values() { + return values(BareMetalMachineKeySetPrivilegeLevel.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java new file mode 100644 index 000000000000..217b2bc5b7bd --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetProvisioningState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the bare metal machine key set. */ +public final class BareMetalMachineKeySetProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for BareMetalMachineKeySetProvisioningState. */ + public static final BareMetalMachineKeySetProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BareMetalMachineKeySetProvisioningState. */ + public static final BareMetalMachineKeySetProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for BareMetalMachineKeySetProvisioningState. */ + public static final BareMetalMachineKeySetProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Accepted for BareMetalMachineKeySetProvisioningState. */ + public static final BareMetalMachineKeySetProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Provisioning for BareMetalMachineKeySetProvisioningState. */ + public static final BareMetalMachineKeySetProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of BareMetalMachineKeySetProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineKeySetProvisioningState() { + } + + /** + * Creates or finds a BareMetalMachineKeySetProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineKeySetProvisioningState. + */ + @JsonCreator + public static BareMetalMachineKeySetProvisioningState fromString(String name) { + return fromString(name, BareMetalMachineKeySetProvisioningState.class); + } + + /** + * Gets known BareMetalMachineKeySetProvisioningState values. + * + * @return known BareMetalMachineKeySetProvisioningState values. + */ + public static Collection values() { + return values(BareMetalMachineKeySetProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java new file mode 100644 index 000000000000..618b3f181952 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySetUserSetupStatus.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the user is currently deployed for access. */ +public final class BareMetalMachineKeySetUserSetupStatus + extends ExpandableStringEnum { + /** Static value Active for BareMetalMachineKeySetUserSetupStatus. */ + public static final BareMetalMachineKeySetUserSetupStatus ACTIVE = fromString("Active"); + + /** Static value Invalid for BareMetalMachineKeySetUserSetupStatus. */ + public static final BareMetalMachineKeySetUserSetupStatus INVALID = fromString("Invalid"); + + /** + * Creates a new instance of BareMetalMachineKeySetUserSetupStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineKeySetUserSetupStatus() { + } + + /** + * Creates or finds a BareMetalMachineKeySetUserSetupStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineKeySetUserSetupStatus. + */ + @JsonCreator + public static BareMetalMachineKeySetUserSetupStatus fromString(String name) { + return fromString(name, BareMetalMachineKeySetUserSetupStatus.class); + } + + /** + * Gets known BareMetalMachineKeySetUserSetupStatus values. + * + * @return known BareMetalMachineKeySetUserSetupStatus values. + */ + public static Collection values() { + return values(BareMetalMachineKeySetUserSetupStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java new file mode 100644 index 000000000000..0bb55687589a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineKeySets.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BareMetalMachineKeySets. */ +public interface BareMetalMachineKeySets { + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName); + + /** + * List bare metal machine key sets of the cluster in the resource group. + * + *

Get a list of bare metal machine key sets of the cluster in the provided resource group. + * + * @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 a list of bare metal machine key sets of the cluster in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context); + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 bare metal machine key set of the provided cluster. + */ + BareMetalMachineKeySet get(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bareMetalMachineKeySetName The name of the bare metal machine key set. + * @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 delete(String resourceGroupName, String clusterName, String bareMetalMachineKeySetName, Context context); + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param id the resource ID. + * @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 bare metal machine key set of the provided cluster along with {@link Response}. + */ + BareMetalMachineKeySet getById(String id); + + /** + * Retrieve the bare metal machine key set of the cluster. + * + *

Get bare metal machine key set of the provided cluster. + * + * @param id the resource ID. + * @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 bare metal machine key set of the provided cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the bare metal machine key set of the cluster. + * + *

Delete the bare metal machine key set of the provided cluster. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BareMetalMachineKeySet resource. + * + * @param name resource name. + * @return the first stage of the new BareMetalMachineKeySet definition. + */ + BareMetalMachineKeySet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java new file mode 100644 index 000000000000..b9b0db1d91de --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachineInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BareMetalMachineList represents a list of bare metal machines. */ +@Fluent +public final class BareMetalMachineList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of bare metal machines. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of BareMetalMachineList class. */ + public BareMetalMachineList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the BareMetalMachineList object itself. + */ + public BareMetalMachineList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of bare metal machines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of bare metal machines. + * + * @param value the value value to set. + * @return the BareMetalMachineList object itself. + */ + public BareMetalMachineList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java new file mode 100644 index 000000000000..e0a85d08f8b6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePatchParameters.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.BareMetalMachinePatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. */ +@Fluent +public final class BareMetalMachinePatchParameters { + /* + * BareMetalMachinePatchProperties represents the properties of the bare metal machine that can be patched. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private BareMetalMachinePatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of BareMetalMachinePatchParameters class. */ + public BareMetalMachinePatchParameters() { + } + + /** + * Get the innerProperties property: BareMetalMachinePatchProperties represents the properties of the bare metal + * machine that can be patched. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private BareMetalMachinePatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the BareMetalMachinePatchParameters object itself. + */ + public BareMetalMachinePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the machineDetails property: The details provided by the customer during the creation of rack manifests that + * allows for custom data to be associated with this machine. + * + * @return the machineDetails value. + */ + public String machineDetails() { + return this.innerProperties() == null ? null : this.innerProperties().machineDetails(); + } + + /** + * Set the machineDetails property: The details provided by the customer during the creation of rack manifests that + * allows for custom data to be associated with this machine. + * + * @param machineDetails the machineDetails value to set. + * @return the BareMetalMachinePatchParameters object itself. + */ + public BareMetalMachinePatchParameters withMachineDetails(String machineDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new BareMetalMachinePatchProperties(); + } + this.innerProperties().withMachineDetails(machineDetails); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java new file mode 100644 index 000000000000..da8123c31251 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerOffParameters.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. */ +@Fluent +public final class BareMetalMachinePowerOffParameters { + /* + * The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. + */ + @JsonProperty(value = "skipShutdown") + private BareMetalMachineSkipShutdown skipShutdown; + + /** Creates an instance of BareMetalMachinePowerOffParameters class. */ + public BareMetalMachinePowerOffParameters() { + } + + /** + * Get the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the bare + * metal machine immediately. + * + * @return the skipShutdown value. + */ + public BareMetalMachineSkipShutdown skipShutdown() { + return this.skipShutdown; + } + + /** + * Set the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the bare + * metal machine immediately. + * + * @param skipShutdown the skipShutdown value to set. + * @return the BareMetalMachinePowerOffParameters object itself. + */ + public BareMetalMachinePowerOffParameters withSkipShutdown(BareMetalMachineSkipShutdown skipShutdown) { + this.skipShutdown = skipShutdown; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.java new file mode 100644 index 000000000000..eaeecffed4e1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachinePowerState.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The power state derived from the baseboard management controller. */ +public final class BareMetalMachinePowerState extends ExpandableStringEnum { + /** Static value On for BareMetalMachinePowerState. */ + public static final BareMetalMachinePowerState ON = fromString("On"); + + /** Static value Off for BareMetalMachinePowerState. */ + public static final BareMetalMachinePowerState OFF = fromString("Off"); + + /** + * Creates a new instance of BareMetalMachinePowerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachinePowerState() { + } + + /** + * Creates or finds a BareMetalMachinePowerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachinePowerState. + */ + @JsonCreator + public static BareMetalMachinePowerState fromString(String name) { + return fromString(name, BareMetalMachinePowerState.class); + } + + /** + * Gets known BareMetalMachinePowerState values. + * + * @return known BareMetalMachinePowerState values. + */ + public static Collection values() { + return values(BareMetalMachinePowerState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java new file mode 100644 index 000000000000..ccbd521e8145 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the bare metal machine. */ +public final class BareMetalMachineProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for BareMetalMachineProvisioningState. */ + public static final BareMetalMachineProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BareMetalMachineProvisioningState. */ + public static final BareMetalMachineProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for BareMetalMachineProvisioningState. */ + public static final BareMetalMachineProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for BareMetalMachineProvisioningState. */ + public static final BareMetalMachineProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for BareMetalMachineProvisioningState. */ + public static final BareMetalMachineProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of BareMetalMachineProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineProvisioningState() { + } + + /** + * Creates or finds a BareMetalMachineProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineProvisioningState. + */ + @JsonCreator + public static BareMetalMachineProvisioningState fromString(String name) { + return fromString(name, BareMetalMachineProvisioningState.class); + } + + /** + * Gets known BareMetalMachineProvisioningState values. + * + * @return known BareMetalMachineProvisioningState values. + */ + public static Collection values() { + return values(BareMetalMachineProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.java new file mode 100644 index 000000000000..4916dbf76236 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReadyState.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the bare metal machine is ready to receive workloads. */ +public final class BareMetalMachineReadyState extends ExpandableStringEnum { + /** Static value True for BareMetalMachineReadyState. */ + public static final BareMetalMachineReadyState TRUE = fromString("True"); + + /** Static value False for BareMetalMachineReadyState. */ + public static final BareMetalMachineReadyState FALSE = fromString("False"); + + /** + * Creates a new instance of BareMetalMachineReadyState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineReadyState() { + } + + /** + * Creates or finds a BareMetalMachineReadyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineReadyState. + */ + @JsonCreator + public static BareMetalMachineReadyState fromString(String name) { + return fromString(name, BareMetalMachineReadyState.class); + } + + /** + * Gets known BareMetalMachineReadyState values. + * + * @return known BareMetalMachineReadyState values. + */ + public static Collection values() { + return values(BareMetalMachineReadyState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java new file mode 100644 index 000000000000..a64f4cdbca9d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineReplaceParameters.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for + * another. + */ +@Fluent +public final class BareMetalMachineReplaceParameters { + /* + * AdministrativeCredentials represents the admin credentials for the device requiring password-based + * authentication. + * + * The credentials of the baseboard management controller on this bare metal machine. + */ + @JsonProperty(value = "bmcCredentials") + private AdministrativeCredentials bmcCredentials; + + /* + * The MAC address of the BMC device. + */ + @JsonProperty(value = "bmcMacAddress") + private String bmcMacAddress; + + /* + * The MAC address of a NIC connected to the PXE network. + */ + @JsonProperty(value = "bootMacAddress") + private String bootMacAddress; + + /* + * The OS-level hostname assigned to this machine. + */ + @JsonProperty(value = "machineName") + private String machineName; + + /* + * The serial number of the bare metal machine. + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** Creates an instance of BareMetalMachineReplaceParameters class. */ + public BareMetalMachineReplaceParameters() { + } + + /** + * Get the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @return the bmcCredentials value. + */ + public AdministrativeCredentials bmcCredentials() { + return this.bmcCredentials; + } + + /** + * Set the bmcCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the baseboard management controller on this bare metal machine. + * + * @param bmcCredentials the bmcCredentials value to set. + * @return the BareMetalMachineReplaceParameters object itself. + */ + public BareMetalMachineReplaceParameters withBmcCredentials(AdministrativeCredentials bmcCredentials) { + this.bmcCredentials = bmcCredentials; + return this; + } + + /** + * Get the bmcMacAddress property: The MAC address of the BMC device. + * + * @return the bmcMacAddress value. + */ + public String bmcMacAddress() { + return this.bmcMacAddress; + } + + /** + * Set the bmcMacAddress property: The MAC address of the BMC device. + * + * @param bmcMacAddress the bmcMacAddress value to set. + * @return the BareMetalMachineReplaceParameters object itself. + */ + public BareMetalMachineReplaceParameters withBmcMacAddress(String bmcMacAddress) { + this.bmcMacAddress = bmcMacAddress; + return this; + } + + /** + * Get the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @return the bootMacAddress value. + */ + public String bootMacAddress() { + return this.bootMacAddress; + } + + /** + * Set the bootMacAddress property: The MAC address of a NIC connected to the PXE network. + * + * @param bootMacAddress the bootMacAddress value to set. + * @return the BareMetalMachineReplaceParameters object itself. + */ + public BareMetalMachineReplaceParameters withBootMacAddress(String bootMacAddress) { + this.bootMacAddress = bootMacAddress; + return this; + } + + /** + * Get the machineName property: The OS-level hostname assigned to this machine. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Set the machineName property: The OS-level hostname assigned to this machine. + * + * @param machineName the machineName value to set. + * @return the BareMetalMachineReplaceParameters object itself. + */ + public BareMetalMachineReplaceParameters withMachineName(String machineName) { + this.machineName = machineName; + return this; + } + + /** + * Get the serialNumber property: The serial number of the bare metal machine. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number of the bare metal machine. + * + * @param serialNumber the serialNumber value to set. + * @return the BareMetalMachineReplaceParameters object itself. + */ + public BareMetalMachineReplaceParameters withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bmcCredentials() != null) { + bmcCredentials().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java new file mode 100644 index 000000000000..cceaa7c617ca --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunCommandParameters.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal + * machine. + */ +@Fluent +public final class BareMetalMachineRunCommandParameters { + /* + * The list of string arguments that will be passed to the script in order as separate arguments. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * The maximum time the script is allowed to run. + * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be + * captured, and the exit code matching a timeout will be returned (252). + */ + @JsonProperty(value = "limitTimeSeconds", required = true) + private long limitTimeSeconds; + + /* + * The base64 encoded script to execute on the bare metal machine. + */ + @JsonProperty(value = "script", required = true) + private String script; + + /** Creates an instance of BareMetalMachineRunCommandParameters class. */ + public BareMetalMachineRunCommandParameters() { + } + + /** + * Get the arguments property: The list of string arguments that will be passed to the script in order as separate + * arguments. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The list of string arguments that will be passed to the script in order as separate + * arguments. + * + * @param arguments the arguments value to set. + * @return the BareMetalMachineRunCommandParameters object itself. + */ + public BareMetalMachineRunCommandParameters withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the limitTimeSeconds property: The maximum time the script is allowed to run. If the execution time exceeds + * the maximum, the script will be stopped, any output produced until then will be captured, and the exit code + * matching a timeout will be returned (252). + * + * @return the limitTimeSeconds value. + */ + public long limitTimeSeconds() { + return this.limitTimeSeconds; + } + + /** + * Set the limitTimeSeconds property: The maximum time the script is allowed to run. If the execution time exceeds + * the maximum, the script will be stopped, any output produced until then will be captured, and the exit code + * matching a timeout will be returned (252). + * + * @param limitTimeSeconds the limitTimeSeconds value to set. + * @return the BareMetalMachineRunCommandParameters object itself. + */ + public BareMetalMachineRunCommandParameters withLimitTimeSeconds(long limitTimeSeconds) { + this.limitTimeSeconds = limitTimeSeconds; + return this; + } + + /** + * Get the script property: The base64 encoded script to execute on the bare metal machine. + * + * @return the script value. + */ + public String script() { + return this.script; + } + + /** + * Set the script property: The base64 encoded script to execute on the bare metal machine. + * + * @param script the script value to set. + * @return the BareMetalMachineRunCommandParameters object itself. + */ + public BareMetalMachineRunCommandParameters withScript(String script) { + this.script = script; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (script() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property script in model BareMetalMachineRunCommandParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineRunCommandParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java new file mode 100644 index 000000000000..7f4c700cd129 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunDataExtractsParameters.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction + * commands to run on the bare metal machine. + */ +@Fluent +public final class BareMetalMachineRunDataExtractsParameters { + /* + * The list of curated data extraction commands to be executed directly against the target machine. + */ + @JsonProperty(value = "commands", required = true) + private List commands; + + /* + * The maximum time the commands are allowed to run. + * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be + * captured, and the exit code matching a timeout will be returned (252). + */ + @JsonProperty(value = "limitTimeSeconds", required = true) + private long limitTimeSeconds; + + /** Creates an instance of BareMetalMachineRunDataExtractsParameters class. */ + public BareMetalMachineRunDataExtractsParameters() { + } + + /** + * Get the commands property: The list of curated data extraction commands to be executed directly against the + * target machine. + * + * @return the commands value. + */ + public List commands() { + return this.commands; + } + + /** + * Set the commands property: The list of curated data extraction commands to be executed directly against the + * target machine. + * + * @param commands the commands value to set. + * @return the BareMetalMachineRunDataExtractsParameters object itself. + */ + public BareMetalMachineRunDataExtractsParameters withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Get the limitTimeSeconds property: The maximum time the commands are allowed to run. If the execution time + * exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit + * code matching a timeout will be returned (252). + * + * @return the limitTimeSeconds value. + */ + public long limitTimeSeconds() { + return this.limitTimeSeconds; + } + + /** + * Set the limitTimeSeconds property: The maximum time the commands are allowed to run. If the execution time + * exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit + * code matching a timeout will be returned (252). + * + * @param limitTimeSeconds the limitTimeSeconds value to set. + * @return the BareMetalMachineRunDataExtractsParameters object itself. + */ + public BareMetalMachineRunDataExtractsParameters withLimitTimeSeconds(long limitTimeSeconds) { + this.limitTimeSeconds = limitTimeSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (commands() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property commands in model BareMetalMachineRunDataExtractsParameters")); + } else { + commands().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineRunDataExtractsParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java new file mode 100644 index 000000000000..38fc92bbc7d2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineRunReadCommandsParameters.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run + * on the bare metal machine. + */ +@Fluent +public final class BareMetalMachineRunReadCommandsParameters { + /* + * The list of read-only commands to be executed directly against the target machine. + */ + @JsonProperty(value = "commands", required = true) + private List commands; + + /* + * The maximum time the commands are allowed to run. + * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be + * captured, and the exit code matching a timeout will be returned (252). + */ + @JsonProperty(value = "limitTimeSeconds", required = true) + private long limitTimeSeconds; + + /** Creates an instance of BareMetalMachineRunReadCommandsParameters class. */ + public BareMetalMachineRunReadCommandsParameters() { + } + + /** + * Get the commands property: The list of read-only commands to be executed directly against the target machine. + * + * @return the commands value. + */ + public List commands() { + return this.commands; + } + + /** + * Set the commands property: The list of read-only commands to be executed directly against the target machine. + * + * @param commands the commands value to set. + * @return the BareMetalMachineRunReadCommandsParameters object itself. + */ + public BareMetalMachineRunReadCommandsParameters withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Get the limitTimeSeconds property: The maximum time the commands are allowed to run. If the execution time + * exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit + * code matching a timeout will be returned (252). + * + * @return the limitTimeSeconds value. + */ + public long limitTimeSeconds() { + return this.limitTimeSeconds; + } + + /** + * Set the limitTimeSeconds property: The maximum time the commands are allowed to run. If the execution time + * exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit + * code matching a timeout will be returned (252). + * + * @param limitTimeSeconds the limitTimeSeconds value to set. + * @return the BareMetalMachineRunReadCommandsParameters object itself. + */ + public BareMetalMachineRunReadCommandsParameters withLimitTimeSeconds(long limitTimeSeconds) { + this.limitTimeSeconds = limitTimeSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (commands() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property commands in model BareMetalMachineRunReadCommandsParameters")); + } else { + commands().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineRunReadCommandsParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.java new file mode 100644 index 000000000000..fd04e88a8959 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineSkipShutdown.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. */ +public final class BareMetalMachineSkipShutdown extends ExpandableStringEnum { + /** Static value True for BareMetalMachineSkipShutdown. */ + public static final BareMetalMachineSkipShutdown TRUE = fromString("True"); + + /** Static value False for BareMetalMachineSkipShutdown. */ + public static final BareMetalMachineSkipShutdown FALSE = fromString("False"); + + /** + * Creates a new instance of BareMetalMachineSkipShutdown value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BareMetalMachineSkipShutdown() { + } + + /** + * Creates or finds a BareMetalMachineSkipShutdown from its string representation. + * + * @param name a name to look for. + * @return the corresponding BareMetalMachineSkipShutdown. + */ + @JsonCreator + public static BareMetalMachineSkipShutdown fromString(String name) { + return fromString(name, BareMetalMachineSkipShutdown.class); + } + + /** + * Gets known BareMetalMachineSkipShutdown values. + * + * @return known BareMetalMachineSkipShutdown values. + */ + public static Collection values() { + return values(BareMetalMachineSkipShutdown.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineValidateHardwareParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineValidateHardwareParameters.java new file mode 100644 index 000000000000..ae97ab038fb8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachineValidateHardwareParameters.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * BareMetalMachineValidateHardwareParameters represents the body of the request to validate the physical hardware of a + * bare metal machine. + */ +@Fluent +public final class BareMetalMachineValidateHardwareParameters { + /* + * The category of hardware validation to perform. + */ + @JsonProperty(value = "validationCategory", required = true) + private BareMetalMachineHardwareValidationCategory validationCategory; + + /** Creates an instance of BareMetalMachineValidateHardwareParameters class. */ + public BareMetalMachineValidateHardwareParameters() { + } + + /** + * Get the validationCategory property: The category of hardware validation to perform. + * + * @return the validationCategory value. + */ + public BareMetalMachineHardwareValidationCategory validationCategory() { + return this.validationCategory; + } + + /** + * Set the validationCategory property: The category of hardware validation to perform. + * + * @param validationCategory the validationCategory value to set. + * @return the BareMetalMachineValidateHardwareParameters object itself. + */ + public BareMetalMachineValidateHardwareParameters withValidationCategory( + BareMetalMachineHardwareValidationCategory validationCategory) { + this.validationCategory = validationCategory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationCategory() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property validationCategory in model" + + " BareMetalMachineValidateHardwareParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BareMetalMachineValidateHardwareParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java new file mode 100644 index 000000000000..25954c039e95 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BareMetalMachines.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BareMetalMachines. */ +public interface BareMetalMachines { + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 a list of bare metal machines in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List bare metal machines in the subscription. + * + *

Get a list of bare metal machines in the provided subscription. + * + * @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 a list of bare metal machines in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of bare metal machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List bare metal machines in the resource group. + * + *

Get a list of bare metal machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of bare metal machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 properties of the provided bare metal machine. + */ + BareMetalMachine getByResourceGroup(String resourceGroupName, String bareMetalMachineName); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 deleteByResourceGroup(String resourceGroupName, String bareMetalMachineName); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 delete(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 cordon(String resourceGroupName, String bareMetalMachineName); + + /** + * Cordon the bare metal machine. + * + *

Cordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineCordonParameters The request body. + * @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 cordon( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineCordonParameters bareMetalMachineCordonParameters, + Context context); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 powerOff(String resourceGroupName, String bareMetalMachineName); + + /** + * Power off the bare metal machine. + * + *

Power off the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachinePowerOffParameters The request body. + * @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 powerOff( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachinePowerOffParameters bareMetalMachinePowerOffParameters, + Context context); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimage(String resourceGroupName, String bareMetalMachineName); + + /** + * Reimage the bare metal machine. + * + *

Reimage the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 reimage(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 replace(String resourceGroupName, String bareMetalMachineName); + + /** + * Replace (service) the bare metal machine. + * + *

Replace the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineReplaceParameters The request body. + * @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 replace( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineReplaceParameters bareMetalMachineReplaceParameters, + Context context); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restart(String resourceGroupName, String bareMetalMachineName); + + /** + * Restart the bare metal machine. + * + *

Restart the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 restart(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters); + + /** + * Run the command on the bare metal machine. + * + *

Run the command or the script on the provided bare metal machine. The URL to storage account with the command + * execution results and the command exit code can be retrieved from the operation status API once available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunCommandParameters The request body. + * @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 runCommand( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunCommandParameters bareMetalMachineRunCommandParameters, + Context context); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters); + + /** + * Run data extraction for a bare metal machine. + * + *

Run one or more data extractions on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunDataExtractsParameters The request body. + * @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 runDataExtracts( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunDataExtractsParameters bareMetalMachineRunDataExtractsParameters, + Context context); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters); + + /** + * Run read-only commands against a bare metal machine. + * + *

Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the + * command execution results and the command exit code can be retrieved from the operation status API once + * available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineRunReadCommandsParameters bareMetalMachineRunReadCommandsParameters, + Context context); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 start(String resourceGroupName, String bareMetalMachineName); + + /** + * Start the bare metal machine. + * + *

Start the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 start(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordon(String resourceGroupName, String bareMetalMachineName); + + /** + * Uncordon the bare metal machine. + * + *

Uncordon the provided bare metal machine's Kubernetes node. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @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 uncordon(String resourceGroupName, String bareMetalMachineName, Context context); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters); + + /** + * Trigger hardware validation of the bare metal machine. + * + *

Validate the hardware of the provided bare metal machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param bareMetalMachineName The name of the bare metal machine. + * @param bareMetalMachineValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String bareMetalMachineName, + BareMetalMachineValidateHardwareParameters bareMetalMachineValidateHardwareParameters, + Context context); + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param id the resource ID. + * @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 properties of the provided bare metal machine along with {@link Response}. + */ + BareMetalMachine getById(String id); + + /** + * Retrieve the bare metal machine. + * + *

Get properties of the provided bare metal machine. + * + * @param id the resource ID. + * @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 properties of the provided bare metal machine along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the bare metal machine. + * + *

Delete the provided bare metal machine. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BareMetalMachine resource. + * + * @param name resource name. + * @return the first stage of the new BareMetalMachine definition. + */ + BareMetalMachine.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpPeer.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpPeer.java new file mode 100644 index 000000000000..30ee5bd7dc3d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BgpPeer.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** BgpPeer represents the IP address and ASN(Autonomous System Number) to peer with Hybrid AKS cluster. */ +@Fluent +public final class BgpPeer { + /* + * The ASN (Autonomous System Number) of the BGP peer. + */ + @JsonProperty(value = "asNumber", required = true) + private long asNumber; + + /* + * The password for this peering neighbor. It defaults to no password if not specified. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The IPv4 or IPv6 address to peer with the associated CNI Network. The IP version type will drive a peering with + * the same version type from the Default CNI Network. For example, IPv4 to IPv4 or IPv6 to IPv6. + */ + @JsonProperty(value = "peerIp", required = true) + private String peerIp; + + /** Creates an instance of BgpPeer class. */ + public BgpPeer() { + } + + /** + * Get the asNumber property: The ASN (Autonomous System Number) of the BGP peer. + * + * @return the asNumber value. + */ + public long asNumber() { + return this.asNumber; + } + + /** + * Set the asNumber property: The ASN (Autonomous System Number) of the BGP peer. + * + * @param asNumber the asNumber value to set. + * @return the BgpPeer object itself. + */ + public BgpPeer withAsNumber(long asNumber) { + this.asNumber = asNumber; + return this; + } + + /** + * Get the password property: The password for this peering neighbor. It defaults to no password if not specified. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password for this peering neighbor. It defaults to no password if not specified. + * + * @param password the password value to set. + * @return the BgpPeer object itself. + */ + public BgpPeer withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the peerIp property: The IPv4 or IPv6 address to peer with the associated CNI Network. The IP version type + * will drive a peering with the same version type from the Default CNI Network. For example, IPv4 to IPv4 or IPv6 + * to IPv6. + * + * @return the peerIp value. + */ + public String peerIp() { + return this.peerIp; + } + + /** + * Set the peerIp property: The IPv4 or IPv6 address to peer with the associated CNI Network. The IP version type + * will drive a peering with the same version type from the Default CNI Network. For example, IPv4 to IPv4 or IPv6 + * to IPv6. + * + * @param peerIp the peerIp value to set. + * @return the BgpPeer object itself. + */ + public BgpPeer withPeerIp(String peerIp) { + this.peerIp = peerIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (peerIp() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property peerIp in model BgpPeer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BgpPeer.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java new file mode 100644 index 000000000000..78103f16857d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySet.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BmcKeySet. */ +public interface BmcKeySet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the azureGroupId property: The object ID of Azure Active Directory group that all users in the list must be + * in for access to be granted. Users that are not in the group will not have access. + * + * @return the azureGroupId value. + */ + String azureGroupId(); + + /** + * Gets the detailedStatus property: The more detailed status of the key set. + * + * @return the detailedStatus value. + */ + BmcKeySetDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @return the expiration value. + */ + OffsetDateTime expiration(); + + /** + * Gets the lastValidation property: The last time this key set was validated. + * + * @return the lastValidation value. + */ + OffsetDateTime lastValidation(); + + /** + * Gets the privilegeLevel property: The access level allowed for the users in this key set. + * + * @return the privilegeLevel value. + */ + BmcKeySetPrivilegeLevel privilegeLevel(); + + /** + * Gets the provisioningState property: The provisioning state of the baseboard management controller key set. + * + * @return the provisioningState value. + */ + BmcKeySetProvisioningState provisioningState(); + + /** + * Gets the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + List userList(); + + /** + * Gets the userListStatus property: The status evaluation of each user. + * + * @return the userListStatus value. + */ + List userListStatus(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner object. + * + * @return the inner object. + */ + BmcKeySetInner innerModel(); + + /** The entirety of the BmcKeySet definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAzureGroupId, + DefinitionStages.WithExpiration, + DefinitionStages.WithPrivilegeLevel, + DefinitionStages.WithUserList, + DefinitionStages.WithCreate { + } + /** The BmcKeySet definition stages. */ + interface DefinitionStages { + /** The first stage of the BmcKeySet definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BmcKeySet definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the BmcKeySet definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithExtendedLocation withExistingCluster(String resourceGroupName, String clusterName); + } + /** The stage of the BmcKeySet definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithAzureGroupId withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the BmcKeySet definition allowing to specify azureGroupId. */ + interface WithAzureGroupId { + /** + * Specifies the azureGroupId property: The object ID of Azure Active Directory group that all users in the + * list must be in for access to be granted. Users that are not in the group will not have access.. + * + * @param azureGroupId The object ID of Azure Active Directory group that all users in the list must be in + * for access to be granted. Users that are not in the group will not have access. + * @return the next definition stage. + */ + WithExpiration withAzureGroupId(String azureGroupId); + } + /** The stage of the BmcKeySet definition allowing to specify expiration. */ + interface WithExpiration { + /** + * Specifies the expiration property: The date and time after which the users in this key set will be + * removed from the baseboard management controllers.. + * + * @param expiration The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * @return the next definition stage. + */ + WithPrivilegeLevel withExpiration(OffsetDateTime expiration); + } + /** The stage of the BmcKeySet definition allowing to specify privilegeLevel. */ + interface WithPrivilegeLevel { + /** + * Specifies the privilegeLevel property: The access level allowed for the users in this key set.. + * + * @param privilegeLevel The access level allowed for the users in this key set. + * @return the next definition stage. + */ + WithUserList withPrivilegeLevel(BmcKeySetPrivilegeLevel privilegeLevel); + } + /** The stage of the BmcKeySet definition allowing to specify userList. */ + interface WithUserList { + /** + * Specifies the userList property: The unique list of permitted users.. + * + * @param userList The unique list of permitted users. + * @return the next definition stage. + */ + WithCreate withUserList(List userList); + } + /** + * The stage of the BmcKeySet 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.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + BmcKeySet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BmcKeySet create(Context context); + } + /** The stage of the BmcKeySet definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the BmcKeySet resource. + * + * @return the stage of resource update. + */ + BmcKeySet.Update update(); + + /** The template for BmcKeySet update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithExpiration, UpdateStages.WithUserList { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BmcKeySet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BmcKeySet apply(Context context); + } + /** The BmcKeySet update stages. */ + interface UpdateStages { + /** The stage of the BmcKeySet update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the BmcKeySet update allowing to specify expiration. */ + interface WithExpiration { + /** + * Specifies the expiration property: The date and time after which the users in this key set will be + * removed from the baseboard management controllers.. + * + * @param expiration The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * @return the next definition stage. + */ + Update withExpiration(OffsetDateTime expiration); + } + /** The stage of the BmcKeySet update allowing to specify userList. */ + interface WithUserList { + /** + * Specifies the userList property: The unique list of permitted users.. + * + * @param userList The unique list of permitted users. + * @return the next definition stage. + */ + Update withUserList(List userList); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BmcKeySet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BmcKeySet refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java new file mode 100644 index 000000000000..662f01e29b72 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetDetailedStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the key set. */ +public final class BmcKeySetDetailedStatus extends ExpandableStringEnum { + /** Static value AllActive for BmcKeySetDetailedStatus. */ + public static final BmcKeySetDetailedStatus ALL_ACTIVE = fromString("AllActive"); + + /** Static value SomeInvalid for BmcKeySetDetailedStatus. */ + public static final BmcKeySetDetailedStatus SOME_INVALID = fromString("SomeInvalid"); + + /** Static value AllInvalid for BmcKeySetDetailedStatus. */ + public static final BmcKeySetDetailedStatus ALL_INVALID = fromString("AllInvalid"); + + /** Static value Validating for BmcKeySetDetailedStatus. */ + public static final BmcKeySetDetailedStatus VALIDATING = fromString("Validating"); + + /** + * Creates a new instance of BmcKeySetDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BmcKeySetDetailedStatus() { + } + + /** + * Creates or finds a BmcKeySetDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BmcKeySetDetailedStatus. + */ + @JsonCreator + public static BmcKeySetDetailedStatus fromString(String name) { + return fromString(name, BmcKeySetDetailedStatus.class); + } + + /** + * Gets known BmcKeySetDetailedStatus values. + * + * @return known BmcKeySetDetailedStatus values. + */ + public static Collection values() { + return values(BmcKeySetDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java new file mode 100644 index 000000000000..dbbc7b7a783b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** BmcKeySetList represents a list of baseboard management controller key sets. */ +@Fluent +public final class BmcKeySetList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of baseboard management controller key sets. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of BmcKeySetList class. */ + public BmcKeySetList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the BmcKeySetList object itself. + */ + public BmcKeySetList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of baseboard management controller key sets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of baseboard management controller key sets. + * + * @param value the value value to set. + * @return the BmcKeySetList object itself. + */ + public BmcKeySetList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java new file mode 100644 index 000000000000..7c561e00261f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPatchParameters.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.BmcKeySetPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. */ +@Fluent +public final class BmcKeySetPatchParameters { + /* + * BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are + * patchable. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private BmcKeySetPatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of BmcKeySetPatchParameters class. */ + public BmcKeySetPatchParameters() { + } + + /** + * Get the innerProperties property: BmcKeySetPatchProperties represents the properties of baseboard management + * controller key set that are patchable. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private BmcKeySetPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the BmcKeySetPatchParameters object itself. + */ + public BmcKeySetPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: The date and time after which the users in this key set will be removed from the + * baseboard management controllers. + * + * @param expiration the expiration value to set. + * @return the BmcKeySetPatchParameters object itself. + */ + public BmcKeySetPatchParameters withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new BmcKeySetPatchProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Get the userList property: The unique list of permitted users. + * + * @return the userList value. + */ + public List userList() { + return this.innerProperties() == null ? null : this.innerProperties().userList(); + } + + /** + * Set the userList property: The unique list of permitted users. + * + * @param userList the userList value to set. + * @return the BmcKeySetPatchParameters object itself. + */ + public BmcKeySetPatchParameters withUserList(List userList) { + if (this.innerProperties() == null) { + this.innerProperties = new BmcKeySetPatchProperties(); + } + this.innerProperties().withUserList(userList); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.java new file mode 100644 index 000000000000..9efb3142b148 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetPrivilegeLevel.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The access level allowed for the users in this key set. */ +public final class BmcKeySetPrivilegeLevel extends ExpandableStringEnum { + /** Static value ReadOnly for BmcKeySetPrivilegeLevel. */ + public static final BmcKeySetPrivilegeLevel READ_ONLY = fromString("ReadOnly"); + + /** Static value Administrator for BmcKeySetPrivilegeLevel. */ + public static final BmcKeySetPrivilegeLevel ADMINISTRATOR = fromString("Administrator"); + + /** + * Creates a new instance of BmcKeySetPrivilegeLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BmcKeySetPrivilegeLevel() { + } + + /** + * Creates or finds a BmcKeySetPrivilegeLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding BmcKeySetPrivilegeLevel. + */ + @JsonCreator + public static BmcKeySetPrivilegeLevel fromString(String name) { + return fromString(name, BmcKeySetPrivilegeLevel.class); + } + + /** + * Gets known BmcKeySetPrivilegeLevel values. + * + * @return known BmcKeySetPrivilegeLevel values. + */ + public static Collection values() { + return values(BmcKeySetPrivilegeLevel.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java new file mode 100644 index 000000000000..0078c11cd9b2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySetProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the baseboard management controller key set. */ +public final class BmcKeySetProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for BmcKeySetProvisioningState. */ + public static final BmcKeySetProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BmcKeySetProvisioningState. */ + public static final BmcKeySetProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for BmcKeySetProvisioningState. */ + public static final BmcKeySetProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Accepted for BmcKeySetProvisioningState. */ + public static final BmcKeySetProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Provisioning for BmcKeySetProvisioningState. */ + public static final BmcKeySetProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of BmcKeySetProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BmcKeySetProvisioningState() { + } + + /** + * Creates or finds a BmcKeySetProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BmcKeySetProvisioningState. + */ + @JsonCreator + public static BmcKeySetProvisioningState fromString(String name) { + return fromString(name, BmcKeySetProvisioningState.class); + } + + /** + * Gets known BmcKeySetProvisioningState values. + * + * @return known BmcKeySetProvisioningState values. + */ + public static Collection values() { + return values(BmcKeySetProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java new file mode 100644 index 000000000000..a24bdf46cc77 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BmcKeySets.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BmcKeySets. */ +public interface BmcKeySets { + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName); + + /** + * List baseboard management controller key sets of the cluster in the resource group. + * + *

Get a list of baseboard management controller key sets of the cluster in the provided resource group. + * + * @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 a list of baseboard management controller key sets of the cluster in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String bmcKeySetName, Context context); + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 baseboard management controller key set of the provided cluster. + */ + BmcKeySet get(String resourceGroupName, String clusterName, String bmcKeySetName); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 delete(String resourceGroupName, String clusterName, String bmcKeySetName); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param bmcKeySetName The name of the baseboard management controller key set. + * @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 delete(String resourceGroupName, String clusterName, String bmcKeySetName, Context context); + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param id the resource ID. + * @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 baseboard management controller key set of the provided cluster along with {@link Response}. + */ + BmcKeySet getById(String id); + + /** + * Retrieve the baseboard management controller key set of the cluster. + * + *

Get baseboard management controller key set of the provided cluster. + * + * @param id the resource ID. + * @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 baseboard management controller key set of the provided cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the baseboard management controller key set of the cluster. + * + *

Delete the baseboard management controller key set of the provided cluster. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BmcKeySet resource. + * + * @param name resource name. + * @return the first stage of the new BmcKeySet definition. + */ + BmcKeySet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java new file mode 100644 index 000000000000..09f083d3f9af --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/BootstrapProtocol.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of bootstrap protocol used. */ +public final class BootstrapProtocol extends ExpandableStringEnum { + /** Static value PXE for BootstrapProtocol. */ + public static final BootstrapProtocol PXE = fromString("PXE"); + + /** + * Creates a new instance of BootstrapProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BootstrapProtocol() { + } + + /** + * Creates or finds a BootstrapProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BootstrapProtocol. + */ + @JsonCreator + public static BootstrapProtocol fromString(String name) { + return fromString(name, BootstrapProtocol.class); + } + + /** + * Gets known BootstrapProtocol values. + * + * @return known BootstrapProtocol values. + */ + public static Collection values() { + return values(BootstrapProtocol.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java new file mode 100644 index 000000000000..c656fdac08f6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetwork.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CloudServicesNetwork. */ +public interface CloudServicesNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @return the additionalEgressEndpoints value. + */ + List additionalEgressEndpoints(); + + /** + * Gets the clusterId property: The resource ID of the Network Cloud cluster this cloud services network is + * associated with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the detailedStatus property: The more detailed status of the cloud services network. + * + * @return the detailedStatus value. + */ + CloudServicesNetworkDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @return the enableDefaultEgressEndpoints value. + */ + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints(); + + /** + * Gets the enabledEgressEndpoints property: The full list of additional and default egress endpoints that are + * currently enabled. + * + * @return the enabledEgressEndpoints value. + */ + List enabledEgressEndpoints(); + + /** + * Gets the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this cloud services network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + List hybridAksClustersAssociatedIds(); + + /** + * Gets the interfaceName property: The name of the interface that will be present in the virtual machine to + * represent this network. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the provisioningState property: The provisioning state of the cloud services network. + * + * @return the provisioningState value. + */ + CloudServicesNetworkProvisioningState provisioningState(); + + /** + * Gets the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid + * AKS virtual machines, that are currently using this cloud services network. + * + * @return the virtualMachinesAssociatedIds value. + */ + List virtualMachinesAssociatedIds(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner object. + * + * @return the inner object. + */ + CloudServicesNetworkInner innerModel(); + + /** The entirety of the CloudServicesNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithCreate { + } + /** The CloudServicesNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the CloudServicesNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the CloudServicesNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the CloudServicesNetwork definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the CloudServicesNetwork definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** + * The stage of the CloudServicesNetwork 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.WithTags, + DefinitionStages.WithAdditionalEgressEndpoints, + DefinitionStages.WithEnableDefaultEgressEndpoints { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudServicesNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudServicesNetwork create(Context context); + } + /** The stage of the CloudServicesNetwork definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the CloudServicesNetwork definition allowing to specify additionalEgressEndpoints. */ + interface WithAdditionalEgressEndpoints { + /** + * Specifies the additionalEgressEndpoints property: The list of egress endpoints. This allows for + * connection from a Hybrid AKS cluster to the specified endpoint.. + * + * @param additionalEgressEndpoints The list of egress endpoints. This allows for connection from a Hybrid + * AKS cluster to the specified endpoint. + * @return the next definition stage. + */ + WithCreate withAdditionalEgressEndpoints(List additionalEgressEndpoints); + } + /** The stage of the CloudServicesNetwork definition allowing to specify enableDefaultEgressEndpoints. */ + interface WithEnableDefaultEgressEndpoints { + /** + * Specifies the enableDefaultEgressEndpoints property: The indicator of whether the platform default + * endpoints are allowed for the egress traffic.. + * + * @param enableDefaultEgressEndpoints The indicator of whether the platform default endpoints are allowed + * for the egress traffic. + * @return the next definition stage. + */ + WithCreate withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints); + } + } + /** + * Begins update for the CloudServicesNetwork resource. + * + * @return the stage of resource update. + */ + CloudServicesNetwork.Update update(); + + /** The template for CloudServicesNetwork update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithAdditionalEgressEndpoints, + UpdateStages.WithEnableDefaultEgressEndpoints { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudServicesNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudServicesNetwork apply(Context context); + } + /** The CloudServicesNetwork update stages. */ + interface UpdateStages { + /** The stage of the CloudServicesNetwork update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the CloudServicesNetwork update allowing to specify additionalEgressEndpoints. */ + interface WithAdditionalEgressEndpoints { + /** + * Specifies the additionalEgressEndpoints property: The list of egress endpoints. This allows for + * connection from a Hybrid AKS cluster to the specified endpoint.. + * + * @param additionalEgressEndpoints The list of egress endpoints. This allows for connection from a Hybrid + * AKS cluster to the specified endpoint. + * @return the next definition stage. + */ + Update withAdditionalEgressEndpoints(List additionalEgressEndpoints); + } + /** The stage of the CloudServicesNetwork update allowing to specify enableDefaultEgressEndpoints. */ + interface WithEnableDefaultEgressEndpoints { + /** + * Specifies the enableDefaultEgressEndpoints property: The indicator of whether the platform default + * endpoints are allowed for the egress traffic.. + * + * @param enableDefaultEgressEndpoints The indicator of whether the platform default endpoints are allowed + * for the egress traffic. + * @return the next definition stage. + */ + Update withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudServicesNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudServicesNetwork refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java new file mode 100644 index 000000000000..a7c51a968e0c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the cloud services network. */ +public final class CloudServicesNetworkDetailedStatus extends ExpandableStringEnum { + /** Static value Error for CloudServicesNetworkDetailedStatus. */ + public static final CloudServicesNetworkDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for CloudServicesNetworkDetailedStatus. */ + public static final CloudServicesNetworkDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for CloudServicesNetworkDetailedStatus. */ + public static final CloudServicesNetworkDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of CloudServicesNetworkDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudServicesNetworkDetailedStatus() { + } + + /** + * Creates or finds a CloudServicesNetworkDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudServicesNetworkDetailedStatus. + */ + @JsonCreator + public static CloudServicesNetworkDetailedStatus fromString(String name) { + return fromString(name, CloudServicesNetworkDetailedStatus.class); + } + + /** + * Gets known CloudServicesNetworkDetailedStatus values. + * + * @return known CloudServicesNetworkDetailedStatus values. + */ + public static Collection values() { + return values(CloudServicesNetworkDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java new file mode 100644 index 000000000000..fb22fd044758 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkEnableDefaultEgressEndpoints.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the platform default endpoints are allowed for the egress traffic. */ +public final class CloudServicesNetworkEnableDefaultEgressEndpoints + extends ExpandableStringEnum { + /** Static value True for CloudServicesNetworkEnableDefaultEgressEndpoints. */ + public static final CloudServicesNetworkEnableDefaultEgressEndpoints TRUE = fromString("True"); + + /** Static value False for CloudServicesNetworkEnableDefaultEgressEndpoints. */ + public static final CloudServicesNetworkEnableDefaultEgressEndpoints FALSE = fromString("False"); + + /** + * Creates a new instance of CloudServicesNetworkEnableDefaultEgressEndpoints value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudServicesNetworkEnableDefaultEgressEndpoints() { + } + + /** + * Creates or finds a CloudServicesNetworkEnableDefaultEgressEndpoints from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudServicesNetworkEnableDefaultEgressEndpoints. + */ + @JsonCreator + public static CloudServicesNetworkEnableDefaultEgressEndpoints fromString(String name) { + return fromString(name, CloudServicesNetworkEnableDefaultEgressEndpoints.class); + } + + /** + * Gets known CloudServicesNetworkEnableDefaultEgressEndpoints values. + * + * @return known CloudServicesNetworkEnableDefaultEgressEndpoints values. + */ + public static Collection values() { + return values(CloudServicesNetworkEnableDefaultEgressEndpoints.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java new file mode 100644 index 000000000000..1b5c64b4f4e1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CloudServicesNetworkList represents a list of cloud services networks. */ +@Fluent +public final class CloudServicesNetworkList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of cloud services networks. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of CloudServicesNetworkList class. */ + public CloudServicesNetworkList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the CloudServicesNetworkList object itself. + */ + public CloudServicesNetworkList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of cloud services networks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cloud services networks. + * + * @param value the value value to set. + * @return the CloudServicesNetworkList object itself. + */ + public CloudServicesNetworkList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java new file mode 100644 index 000000000000..f27f8b8706bd --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkPatchParameters.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.CloudServicesNetworkPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. */ +@Fluent +public final class CloudServicesNetworkPatchParameters { + /* + * CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated + * using a patch request. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private CloudServicesNetworkPatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of CloudServicesNetworkPatchParameters class. */ + public CloudServicesNetworkPatchParameters() { + } + + /** + * Get the innerProperties property: CloudServicesNetworkPatchProperties represents the properties of the cloud + * services network that can be updated using a patch request. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private CloudServicesNetworkPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the CloudServicesNetworkPatchParameters object itself. + */ + public CloudServicesNetworkPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @return the additionalEgressEndpoints value. + */ + public List additionalEgressEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().additionalEgressEndpoints(); + } + + /** + * Set the additionalEgressEndpoints property: The list of egress endpoints. This allows for connection from a + * Hybrid AKS cluster to the specified endpoint. + * + * @param additionalEgressEndpoints the additionalEgressEndpoints value to set. + * @return the CloudServicesNetworkPatchParameters object itself. + */ + public CloudServicesNetworkPatchParameters withAdditionalEgressEndpoints( + List additionalEgressEndpoints) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudServicesNetworkPatchProperties(); + } + this.innerProperties().withAdditionalEgressEndpoints(additionalEgressEndpoints); + return this; + } + + /** + * Get the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @return the enableDefaultEgressEndpoints value. + */ + public CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().enableDefaultEgressEndpoints(); + } + + /** + * Set the enableDefaultEgressEndpoints property: The indicator of whether the platform default endpoints are + * allowed for the egress traffic. + * + * @param enableDefaultEgressEndpoints the enableDefaultEgressEndpoints value to set. + * @return the CloudServicesNetworkPatchParameters object itself. + */ + public CloudServicesNetworkPatchParameters withEnableDefaultEgressEndpoints( + CloudServicesNetworkEnableDefaultEgressEndpoints enableDefaultEgressEndpoints) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudServicesNetworkPatchProperties(); + } + this.innerProperties().withEnableDefaultEgressEndpoints(enableDefaultEgressEndpoints); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java new file mode 100644 index 000000000000..b5b601d60d33 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworkProvisioningState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the cloud services network. */ +public final class CloudServicesNetworkProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for CloudServicesNetworkProvisioningState. */ + public static final CloudServicesNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CloudServicesNetworkProvisioningState. */ + public static final CloudServicesNetworkProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for CloudServicesNetworkProvisioningState. */ + public static final CloudServicesNetworkProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for CloudServicesNetworkProvisioningState. */ + public static final CloudServicesNetworkProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for CloudServicesNetworkProvisioningState. */ + public static final CloudServicesNetworkProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of CloudServicesNetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudServicesNetworkProvisioningState() { + } + + /** + * Creates or finds a CloudServicesNetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudServicesNetworkProvisioningState. + */ + @JsonCreator + public static CloudServicesNetworkProvisioningState fromString(String name) { + return fromString(name, CloudServicesNetworkProvisioningState.class); + } + + /** + * Gets known CloudServicesNetworkProvisioningState values. + * + * @return known CloudServicesNetworkProvisioningState values. + */ + public static Collection values() { + return values(CloudServicesNetworkProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java new file mode 100644 index 000000000000..c93b87d4ed1e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CloudServicesNetworks.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CloudServicesNetworks. */ +public interface CloudServicesNetworks { + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 a list of cloud services networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List cloud services networks in the subscription. + * + *

Get a list of cloud services networks in the provided subscription. + * + * @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 a list of cloud services networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cloud services networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List cloud services networks in the resource group. + * + *

Get a list of cloud services networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cloud services networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String cloudServicesNetworkName, Context context); + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 properties of the provided cloud services network. + */ + CloudServicesNetwork getByResourceGroup(String resourceGroupName, String cloudServicesNetworkName); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 deleteByResourceGroup(String resourceGroupName, String cloudServicesNetworkName); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudServicesNetworkName The name of the cloud services network. + * @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 delete(String resourceGroupName, String cloudServicesNetworkName, Context context); + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param id the resource ID. + * @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 properties of the provided cloud services network along with {@link Response}. + */ + CloudServicesNetwork getById(String id); + + /** + * Retrieve the cloud services network. + * + *

Get properties of the provided cloud services network. + * + * @param id the resource ID. + * @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 properties of the provided cloud services network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the cloud services network. + * + *

Delete the provided cloud services network. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudServicesNetwork resource. + * + * @param name resource name. + * @return the first stage of the new CloudServicesNetwork definition. + */ + CloudServicesNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java new file mode 100644 index 000000000000..696c6fff9477 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Cluster.java @@ -0,0 +1,692 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Cluster. */ +public interface Cluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster manager associated with the cluster. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @return the aggregatorOrSingleRackDefinition value. + */ + RackDefinition aggregatorOrSingleRackDefinition(); + + /** + * Gets the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be used for + * storing relevant logs. + * + * @return the analyticsWorkspaceId value. + */ + String analyticsWorkspaceId(); + + /** + * Gets the availableUpgradeVersions property: The list of cluster runtime version upgrades available for this + * cluster. + * + * @return the availableUpgradeVersions value. + */ + List availableUpgradeVersions(); + + /** + * Gets the clusterCapacity property: ClusterCapacity represents various details regarding compute capacity. + * + *

The capacity supported by this cluster. + * + * @return the clusterCapacity value. + */ + ClusterCapacity clusterCapacity(); + + /** + * Gets the clusterConnectionStatus property: The latest heartbeat status between the cluster manager and the + * cluster. + * + * @return the clusterConnectionStatus value. + */ + ClusterConnectionStatus clusterConnectionStatus(); + + /** + * Gets the clusterExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the cluster's control plane location. This extended + * location is used to route the requests of child objects of the cluster that are handled by the platform operator. + * + * @return the clusterExtendedLocation value. + */ + ExtendedLocation clusterExtendedLocation(); + + /** + * Gets the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @return the clusterLocation value. + */ + String clusterLocation(); + + /** + * Gets the clusterManagerConnectionStatus property: The latest connectivity status between cluster manager and the + * cluster. + * + * @return the clusterManagerConnectionStatus value. + */ + ClusterManagerConnectionStatus clusterManagerConnectionStatus(); + + /** + * Gets the clusterManagerId property: The resource ID of the cluster manager that manages this cluster. This is set + * by the Cluster Manager when the cluster is created. + * + * @return the clusterManagerId value. + */ + String clusterManagerId(); + + /** + * Gets the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @return the clusterServicePrincipal value. + */ + ServicePrincipalInformation clusterServicePrincipal(); + + /** + * Gets the clusterType property: The type of rack configuration for the cluster. + * + * @return the clusterType value. + */ + ClusterType clusterType(); + + /** + * Gets the clusterVersion property: The current runtime version of the cluster. + * + * @return the clusterVersion value. + */ + String clusterVersion(); + + /** + * Gets the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @return the computeDeploymentThreshold value. + */ + ValidationThreshold computeDeploymentThreshold(); + + /** + * Gets the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @return the computeRackDefinitions value. + */ + List computeRackDefinitions(); + + /** + * Gets the detailedStatus property: The current detailed status of the cluster. + * + * @return the detailedStatus value. + */ + ClusterDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the hybridAksExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the Hybrid AKS control plane location. This extended + * location is used when creating provisioned clusters (Hybrid AKS clusters). + * + * @return the hybridAksExtendedLocation value. + */ + ExtendedLocation hybridAksExtendedLocation(); + + /** + * Gets the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + ManagedResourceGroupConfiguration managedResourceGroupConfiguration(); + + /** + * Gets the manualActionCount property: The count of Manual Action Taken (MAT) events that have not been validated. + * + * @return the manualActionCount value. + */ + Long manualActionCount(); + + /** + * Gets the networkFabricId property: The resource ID of the Network Fabric associated with the cluster. + * + * @return the networkFabricId value. + */ + String networkFabricId(); + + /** + * Gets the provisioningState property: The provisioning state of the cluster. + * + * @return the provisioningState value. + */ + ClusterProvisioningState provisioningState(); + + /** + * Gets the supportExpiryDate property: The support end date of the runtime version of the cluster. + * + * @return the supportExpiryDate value. + */ + String supportExpiryDate(); + + /** + * Gets the workloadResourceIds property: The list of workload resource IDs that are hosted within this cluster. + * + * @return the workloadResourceIds value. + */ + List workloadResourceIds(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAggregatorOrSingleRackDefinition, + DefinitionStages.WithAnalyticsWorkspaceId, + DefinitionStages.WithClusterType, + DefinitionStages.WithClusterVersion, + DefinitionStages.WithNetworkFabricId, + DefinitionStages.WithCreate { + } + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Cluster definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Cluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Cluster definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster manager associated with the cluster.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster manager associated with the cluster. + * @return the next definition stage. + */ + WithAggregatorOrSingleRackDefinition withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Cluster definition allowing to specify aggregatorOrSingleRackDefinition. */ + interface WithAggregatorOrSingleRackDefinition { + /** + * Specifies the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the + * rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an + * aggregator rack in a multi-rack cluster.. + * + * @param aggregatorOrSingleRackDefinition RackDefinition represents details regarding the rack. + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an + * aggregator rack in a multi-rack cluster. + * @return the next definition stage. + */ + WithAnalyticsWorkspaceId withAggregatorOrSingleRackDefinition( + RackDefinition aggregatorOrSingleRackDefinition); + } + /** The stage of the Cluster definition allowing to specify analyticsWorkspaceId. */ + interface WithAnalyticsWorkspaceId { + /** + * Specifies the analyticsWorkspaceId property: The resource ID of the Log Analytics Workspace that will be + * used for storing relevant logs.. + * + * @param analyticsWorkspaceId The resource ID of the Log Analytics Workspace that will be used for storing + * relevant logs. + * @return the next definition stage. + */ + WithClusterType withAnalyticsWorkspaceId(String analyticsWorkspaceId); + } + /** The stage of the Cluster definition allowing to specify clusterType. */ + interface WithClusterType { + /** + * Specifies the clusterType property: The type of rack configuration for the cluster.. + * + * @param clusterType The type of rack configuration for the cluster. + * @return the next definition stage. + */ + WithClusterVersion withClusterType(ClusterType clusterType); + } + /** The stage of the Cluster definition allowing to specify clusterVersion. */ + interface WithClusterVersion { + /** + * Specifies the clusterVersion property: The current runtime version of the cluster.. + * + * @param clusterVersion The current runtime version of the cluster. + * @return the next definition stage. + */ + WithNetworkFabricId withClusterVersion(String clusterVersion); + } + /** The stage of the Cluster definition allowing to specify networkFabricId. */ + interface WithNetworkFabricId { + /** + * Specifies the networkFabricId property: The resource ID of the Network Fabric associated with the + * cluster.. + * + * @param networkFabricId The resource ID of the Network Fabric associated with the cluster. + * @return the next definition stage. + */ + WithCreate withNetworkFabricId(String networkFabricId); + } + /** + * The stage of the Cluster 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.WithTags, + DefinitionStages.WithClusterLocation, + DefinitionStages.WithClusterServicePrincipal, + DefinitionStages.WithComputeDeploymentThreshold, + DefinitionStages.WithComputeRackDefinitions, + DefinitionStages.WithManagedResourceGroupConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + /** The stage of the Cluster definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Cluster definition allowing to specify clusterLocation. */ + interface WithClusterLocation { + /** + * Specifies the clusterLocation property: The customer-provided location information to identify where the + * cluster resides.. + * + * @param clusterLocation The customer-provided location information to identify where the cluster resides. + * @return the next definition stage. + */ + WithCreate withClusterLocation(String clusterLocation); + } + /** The stage of the Cluster definition allowing to specify clusterServicePrincipal. */ + interface WithClusterServicePrincipal { + /** + * Specifies the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the + * service principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation.. + * + * @param clusterServicePrincipal ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + *

The service principal to be used by the cluster during Arc Appliance installation. + * @return the next definition stage. + */ + WithCreate withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal); + } + /** The stage of the Cluster definition allowing to specify computeDeploymentThreshold. */ + interface WithComputeDeploymentThreshold { + /** + * Specifies the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node + * hardware and deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment + * validation and deployment.. + * + * @param computeDeploymentThreshold ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + *

The validation threshold indicating the allowable failures of compute machines during environment + * validation and deployment. + * @return the next definition stage. + */ + WithCreate withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold); + } + /** The stage of the Cluster definition allowing to specify computeRackDefinitions. */ + interface WithComputeRackDefinitions { + /** + * Specifies the computeRackDefinitions property: The list of rack definitions for the compute racks in a + * multi-rack cluster, or an empty list in a single-rack cluster.. + * + * @param computeRackDefinitions The list of rack definitions for the compute racks in a multi-rack cluster, + * or an empty list in a single-rack cluster. + * @return the next definition stage. + */ + WithCreate withComputeRackDefinitions(List computeRackDefinitions); + } + /** The stage of the Cluster definition allowing to specify managedResourceGroupConfiguration. */ + interface WithManagedResourceGroupConfiguration { + /** + * Specifies the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents + * the configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource.. + * + * @param managedResourceGroupConfiguration ManagedResourceGroupConfiguration represents the configuration + * of the resource group managed by Azure. + *

The configuration of the managed resource group associated with the resource. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration); + } + } + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** The template for Cluster update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithAggregatorOrSingleRackDefinition, + UpdateStages.WithClusterLocation, + UpdateStages.WithClusterServicePrincipal, + UpdateStages.WithComputeDeploymentThreshold, + UpdateStages.WithComputeRackDefinitions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + /** The Cluster update stages. */ + interface UpdateStages { + /** The stage of the Cluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Cluster update allowing to specify aggregatorOrSingleRackDefinition. */ + interface WithAggregatorOrSingleRackDefinition { + /** + * Specifies the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the + * rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an + * aggregator rack in a multi-rack cluster.. + * + * @param aggregatorOrSingleRackDefinition RackDefinition represents details regarding the rack. + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an + * aggregator rack in a multi-rack cluster. + * @return the next definition stage. + */ + Update withAggregatorOrSingleRackDefinition(RackDefinition aggregatorOrSingleRackDefinition); + } + /** The stage of the Cluster update allowing to specify clusterLocation. */ + interface WithClusterLocation { + /** + * Specifies the clusterLocation property: The customer-provided location information to identify where the + * cluster resides.. + * + * @param clusterLocation The customer-provided location information to identify where the cluster resides. + * @return the next definition stage. + */ + Update withClusterLocation(String clusterLocation); + } + /** The stage of the Cluster update allowing to specify clusterServicePrincipal. */ + interface WithClusterServicePrincipal { + /** + * Specifies the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the + * service principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation.. + * + * @param clusterServicePrincipal ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + *

The service principal to be used by the cluster during Arc Appliance installation. + * @return the next definition stage. + */ + Update withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal); + } + /** The stage of the Cluster update allowing to specify computeDeploymentThreshold. */ + interface WithComputeDeploymentThreshold { + /** + * Specifies the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node + * hardware and deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment + * validation and deployment.. + * + * @param computeDeploymentThreshold ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + *

The validation threshold indicating the allowable failures of compute machines during environment + * validation and deployment. + * @return the next definition stage. + */ + Update withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold); + } + /** The stage of the Cluster update allowing to specify computeRackDefinitions. */ + interface WithComputeRackDefinitions { + /** + * Specifies the computeRackDefinitions property: The list of rack definitions for the compute racks in a + * multi-rack cluster, or an empty list in a single-rack cluster.. + * + * @param computeRackDefinitions The list of rack definitions for the compute racks in a multi-rack cluster, + * or an empty list in a single-rack cluster. + * @return the next definition stage. + */ + Update withComputeRackDefinitions(List computeRackDefinitions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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 deploy(); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param clusterDeployParameters The request body. + * @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 deploy(ClusterDeployParameters clusterDeployParameters, Context context); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion(ClusterUpdateVersionParameters clusterUpdateVersionParameters); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion(ClusterUpdateVersionParameters clusterUpdateVersionParameters, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java new file mode 100644 index 000000000000..ef45a2b49f29 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableUpgradeVersion.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. */ +@Immutable +public final class ClusterAvailableUpgradeVersion { + /* + * The indicator of whether the control plane will be impacted during the upgrade. + */ + @JsonProperty(value = "controlImpact", access = JsonProperty.Access.WRITE_ONLY) + private ControlImpact controlImpact; + + /* + * The expected duration needed for this upgrade. + */ + @JsonProperty(value = "expectedDuration", access = JsonProperty.Access.WRITE_ONLY) + private String expectedDuration; + + /* + * The impact description including the specific details and release notes. + */ + @JsonProperty(value = "impactDescription", access = JsonProperty.Access.WRITE_ONLY) + private String impactDescription; + + /* + * The last date the version of the platform is supported. + */ + @JsonProperty(value = "supportExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private String supportExpiryDate; + + /* + * The target version this cluster will be upgraded to. + */ + @JsonProperty(value = "targetClusterVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetClusterVersion; + + /* + * The indicator of whether the workload will be impacted during the upgrade. + */ + @JsonProperty(value = "workloadImpact", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadImpact workloadImpact; + + /** Creates an instance of ClusterAvailableUpgradeVersion class. */ + public ClusterAvailableUpgradeVersion() { + } + + /** + * Get the controlImpact property: The indicator of whether the control plane will be impacted during the upgrade. + * + * @return the controlImpact value. + */ + public ControlImpact controlImpact() { + return this.controlImpact; + } + + /** + * Get the expectedDuration property: The expected duration needed for this upgrade. + * + * @return the expectedDuration value. + */ + public String expectedDuration() { + return this.expectedDuration; + } + + /** + * Get the impactDescription property: The impact description including the specific details and release notes. + * + * @return the impactDescription value. + */ + public String impactDescription() { + return this.impactDescription; + } + + /** + * Get the supportExpiryDate property: The last date the version of the platform is supported. + * + * @return the supportExpiryDate value. + */ + public String supportExpiryDate() { + return this.supportExpiryDate; + } + + /** + * Get the targetClusterVersion property: The target version this cluster will be upgraded to. + * + * @return the targetClusterVersion value. + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Get the workloadImpact property: The indicator of whether the workload will be impacted during the upgrade. + * + * @return the workloadImpact value. + */ + public WorkloadImpact workloadImpact() { + return this.workloadImpact; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java new file mode 100644 index 000000000000..24ecfc585a7d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterAvailableVersion.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ClusterAvailableVersion represents the cluster version that the cluster manager can be asked to create and manage. + */ +@Immutable +public final class ClusterAvailableVersion { + /* + * The last date the version of the platform is supported. + */ + @JsonProperty(value = "supportExpiryDate", access = JsonProperty.Access.WRITE_ONLY) + private String supportExpiryDate; + + /* + * The version of the cluster to be deployed. + */ + @JsonProperty(value = "targetClusterVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetClusterVersion; + + /** Creates an instance of ClusterAvailableVersion class. */ + public ClusterAvailableVersion() { + } + + /** + * Get the supportExpiryDate property: The last date the version of the platform is supported. + * + * @return the supportExpiryDate value. + */ + public String supportExpiryDate() { + return this.supportExpiryDate; + } + + /** + * Get the targetClusterVersion property: The version of the cluster to be deployed. + * + * @return the targetClusterVersion value. + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java new file mode 100644 index 000000000000..9b5c709ead36 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterCapacity.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ClusterCapacity represents various details regarding compute capacity. */ +@Fluent +public final class ClusterCapacity { + /* + * The remaining appliance-based storage in GB available for workload use. + */ + @JsonProperty(value = "availableApplianceStorageGB") + private Long availableApplianceStorageGB; + + /* + * The remaining number of cores that are available in this cluster for workload use. + */ + @JsonProperty(value = "availableCoreCount") + private Long availableCoreCount; + + /* + * The remaining machine or host-based storage in GB available for workload use. + */ + @JsonProperty(value = "availableHostStorageGB") + private Long availableHostStorageGB; + + /* + * The remaining memory in GB that are available in this cluster for workload use. + */ + @JsonProperty(value = "availableMemoryGB") + private Long availableMemoryGB; + + /* + * The total appliance-based storage in GB supported by this cluster for workload use. + */ + @JsonProperty(value = "totalApplianceStorageGB") + private Long totalApplianceStorageGB; + + /* + * The total number of cores that are supported by this cluster for workload use. + */ + @JsonProperty(value = "totalCoreCount") + private Long totalCoreCount; + + /* + * The total machine or host-based storage in GB supported by this cluster for workload use. + */ + @JsonProperty(value = "totalHostStorageGB") + private Long totalHostStorageGB; + + /* + * The total memory supported by this cluster for workload use. + */ + @JsonProperty(value = "totalMemoryGB") + private Long totalMemoryGB; + + /** Creates an instance of ClusterCapacity class. */ + public ClusterCapacity() { + } + + /** + * Get the availableApplianceStorageGB property: The remaining appliance-based storage in GB available for workload + * use. + * + * @return the availableApplianceStorageGB value. + */ + public Long availableApplianceStorageGB() { + return this.availableApplianceStorageGB; + } + + /** + * Set the availableApplianceStorageGB property: The remaining appliance-based storage in GB available for workload + * use. + * + * @param availableApplianceStorageGB the availableApplianceStorageGB value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withAvailableApplianceStorageGB(Long availableApplianceStorageGB) { + this.availableApplianceStorageGB = availableApplianceStorageGB; + return this; + } + + /** + * Get the availableCoreCount property: The remaining number of cores that are available in this cluster for + * workload use. + * + * @return the availableCoreCount value. + */ + public Long availableCoreCount() { + return this.availableCoreCount; + } + + /** + * Set the availableCoreCount property: The remaining number of cores that are available in this cluster for + * workload use. + * + * @param availableCoreCount the availableCoreCount value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withAvailableCoreCount(Long availableCoreCount) { + this.availableCoreCount = availableCoreCount; + return this; + } + + /** + * Get the availableHostStorageGB property: The remaining machine or host-based storage in GB available for workload + * use. + * + * @return the availableHostStorageGB value. + */ + public Long availableHostStorageGB() { + return this.availableHostStorageGB; + } + + /** + * Set the availableHostStorageGB property: The remaining machine or host-based storage in GB available for workload + * use. + * + * @param availableHostStorageGB the availableHostStorageGB value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withAvailableHostStorageGB(Long availableHostStorageGB) { + this.availableHostStorageGB = availableHostStorageGB; + return this; + } + + /** + * Get the availableMemoryGB property: The remaining memory in GB that are available in this cluster for workload + * use. + * + * @return the availableMemoryGB value. + */ + public Long availableMemoryGB() { + return this.availableMemoryGB; + } + + /** + * Set the availableMemoryGB property: The remaining memory in GB that are available in this cluster for workload + * use. + * + * @param availableMemoryGB the availableMemoryGB value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withAvailableMemoryGB(Long availableMemoryGB) { + this.availableMemoryGB = availableMemoryGB; + return this; + } + + /** + * Get the totalApplianceStorageGB property: The total appliance-based storage in GB supported by this cluster for + * workload use. + * + * @return the totalApplianceStorageGB value. + */ + public Long totalApplianceStorageGB() { + return this.totalApplianceStorageGB; + } + + /** + * Set the totalApplianceStorageGB property: The total appliance-based storage in GB supported by this cluster for + * workload use. + * + * @param totalApplianceStorageGB the totalApplianceStorageGB value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withTotalApplianceStorageGB(Long totalApplianceStorageGB) { + this.totalApplianceStorageGB = totalApplianceStorageGB; + return this; + } + + /** + * Get the totalCoreCount property: The total number of cores that are supported by this cluster for workload use. + * + * @return the totalCoreCount value. + */ + public Long totalCoreCount() { + return this.totalCoreCount; + } + + /** + * Set the totalCoreCount property: The total number of cores that are supported by this cluster for workload use. + * + * @param totalCoreCount the totalCoreCount value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withTotalCoreCount(Long totalCoreCount) { + this.totalCoreCount = totalCoreCount; + return this; + } + + /** + * Get the totalHostStorageGB property: The total machine or host-based storage in GB supported by this cluster for + * workload use. + * + * @return the totalHostStorageGB value. + */ + public Long totalHostStorageGB() { + return this.totalHostStorageGB; + } + + /** + * Set the totalHostStorageGB property: The total machine or host-based storage in GB supported by this cluster for + * workload use. + * + * @param totalHostStorageGB the totalHostStorageGB value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withTotalHostStorageGB(Long totalHostStorageGB) { + this.totalHostStorageGB = totalHostStorageGB; + return this; + } + + /** + * Get the totalMemoryGB property: The total memory supported by this cluster for workload use. + * + * @return the totalMemoryGB value. + */ + public Long totalMemoryGB() { + return this.totalMemoryGB; + } + + /** + * Set the totalMemoryGB property: The total memory supported by this cluster for workload use. + * + * @param totalMemoryGB the totalMemoryGB value to set. + * @return the ClusterCapacity object itself. + */ + public ClusterCapacity withTotalMemoryGB(Long totalMemoryGB) { + this.totalMemoryGB = totalMemoryGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java new file mode 100644 index 000000000000..ef5ca2ebecfe --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterConnectionStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The latest heartbeat status between the cluster manager and the cluster. */ +public final class ClusterConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for ClusterConnectionStatus. */ + public static final ClusterConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Timeout for ClusterConnectionStatus. */ + public static final ClusterConnectionStatus TIMEOUT = fromString("Timeout"); + + /** Static value Undefined for ClusterConnectionStatus. */ + public static final ClusterConnectionStatus UNDEFINED = fromString("Undefined"); + + /** + * Creates a new instance of ClusterConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterConnectionStatus() { + } + + /** + * Creates or finds a ClusterConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterConnectionStatus. + */ + @JsonCreator + public static ClusterConnectionStatus fromString(String name) { + return fromString(name, ClusterConnectionStatus.class); + } + + /** + * Gets known ClusterConnectionStatus values. + * + * @return known ClusterConnectionStatus values. + */ + public static Collection values() { + return values(ClusterConnectionStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java new file mode 100644 index 000000000000..9d81e763644e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDeployParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterDeployParameters represents the body of the request to deploy cluster. */ +@Fluent +public final class ClusterDeployParameters { + /* + * The names of bare metal machines in the cluster that should be skipped during environment validation. + */ + @JsonProperty(value = "skipValidationsForMachines") + private List skipValidationsForMachines; + + /** Creates an instance of ClusterDeployParameters class. */ + public ClusterDeployParameters() { + } + + /** + * Get the skipValidationsForMachines property: The names of bare metal machines in the cluster that should be + * skipped during environment validation. + * + * @return the skipValidationsForMachines value. + */ + public List skipValidationsForMachines() { + return this.skipValidationsForMachines; + } + + /** + * Set the skipValidationsForMachines property: The names of bare metal machines in the cluster that should be + * skipped during environment validation. + * + * @param skipValidationsForMachines the skipValidationsForMachines value to set. + * @return the ClusterDeployParameters object itself. + */ + public ClusterDeployParameters withSkipValidationsForMachines(List skipValidationsForMachines) { + this.skipValidationsForMachines = skipValidationsForMachines; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java new file mode 100644 index 000000000000..784dbdd6ce9c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterDetailedStatus.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current detailed status of the cluster. */ +public final class ClusterDetailedStatus extends ExpandableStringEnum { + /** Static value PendingDeployment for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus PENDING_DEPLOYMENT = fromString("PendingDeployment"); + + /** Static value Deploying for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus DEPLOYING = fromString("Deploying"); + + /** Static value Running for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus RUNNING = fromString("Running"); + + /** Static value Updating for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus UPDATING = fromString("Updating"); + + /** Static value Degraded for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus DEGRADED = fromString("Degraded"); + + /** Static value Deleting for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus DELETING = fromString("Deleting"); + + /** Static value Disconnected for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value Failed for ClusterDetailedStatus. */ + public static final ClusterDetailedStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of ClusterDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterDetailedStatus() { + } + + /** + * Creates or finds a ClusterDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterDetailedStatus. + */ + @JsonCreator + public static ClusterDetailedStatus fromString(String name) { + return fromString(name, ClusterDetailedStatus.class); + } + + /** + * Gets known ClusterDetailedStatus values. + * + * @return known ClusterDetailedStatus values. + */ + public static Collection values() { + return values(ClusterDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java new file mode 100644 index 000000000000..422d39b351df --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterList represents a list of clusters. */ +@Fluent +public final class ClusterList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of clusters. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ClusterList class. */ + public ClusterList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ClusterList object itself. + */ + public ClusterList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of clusters. + * + * @param value the value value to set. + * @return the ClusterList object itself. + */ + public ClusterList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java new file mode 100644 index 000000000000..4b9c53bc322b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManager.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ClusterManager. */ +public interface ClusterManager { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs + * collection. + * + * @return the analyticsWorkspaceId value. + */ + String analyticsWorkspaceId(); + + /** + * Gets the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The Azure availability zones within the region that + * will be used to support the cluster manager resource. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in + * clusterVersion property of a cluster resource. + * + * @return the clusterVersions value. + */ + List clusterVersions(); + + /** + * Gets the detailedStatus property: The detailed status that provides additional information about the cluster + * manager. + * + * @return the detailedStatus value. + */ + ClusterManagerDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with + * the cluster manager. + * + * @return the fabricControllerId value. + */ + String fabricControllerId(); + + /** + * Gets the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the + * configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource. + * + * @return the managedResourceGroupConfiguration value. + */ + ManagedResourceGroupConfiguration managedResourceGroupConfiguration(); + + /** + * Gets the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location (custom location) that represents the cluster manager's control plane location. This + * extended location is used when creating cluster and rack manifest resources. + * + * @return the managerExtendedLocation value. + */ + ExtendedLocation managerExtendedLocation(); + + /** + * Gets the provisioningState property: The provisioning state of the cluster manager. + * + * @return the provisioningState value. + */ + ClusterManagerProvisioningState provisioningState(); + + /** + * Gets the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation + * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the + * cluster manager resource. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner object. + * + * @return the inner object. + */ + ClusterManagerInner innerModel(); + + /** The entirety of the ClusterManager definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithFabricControllerId, + DefinitionStages.WithCreate { + } + /** The ClusterManager definition stages. */ + interface DefinitionStages { + /** The first stage of the ClusterManager definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ClusterManager definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ClusterManager definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithFabricControllerId withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the ClusterManager definition allowing to specify fabricControllerId. */ + interface WithFabricControllerId { + /** + * Specifies the fabricControllerId property: The resource ID of the fabric controller that has one to one + * mapping with the cluster manager.. + * + * @param fabricControllerId The resource ID of the fabric controller that has one to one mapping with the + * cluster manager. + * @return the next definition stage. + */ + WithCreate withFabricControllerId(String fabricControllerId); + } + /** + * The stage of the ClusterManager 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.WithTags, + DefinitionStages.WithAnalyticsWorkspaceId, + DefinitionStages.WithAvailabilityZones, + DefinitionStages.WithManagedResourceGroupConfiguration, + DefinitionStages.WithVmSize { + /** + * Executes the create request. + * + * @return the created resource. + */ + ClusterManager create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ClusterManager create(Context context); + } + /** The stage of the ClusterManager definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ClusterManager definition allowing to specify analyticsWorkspaceId. */ + interface WithAnalyticsWorkspaceId { + /** + * Specifies the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used + * for the logs collection.. + * + * @param analyticsWorkspaceId The resource ID of the Log Analytics workspace that is used for the logs + * collection. + * @return the next definition stage. + */ + WithCreate withAnalyticsWorkspaceId(String analyticsWorkspaceId); + } + /** The stage of the ClusterManager definition allowing to specify availabilityZones. */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: Field deprecated, this value will no longer influence the + * cluster manager allocation process and will be removed in a future version. The Azure availability zones + * within the region that will be used to support the cluster manager resource.. + * + * @param availabilityZones Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The Azure availability zones within the + * region that will be used to support the cluster manager resource. + * @return the next definition stage. + */ + WithCreate withAvailabilityZones(List availabilityZones); + } + /** The stage of the ClusterManager definition allowing to specify managedResourceGroupConfiguration. */ + interface WithManagedResourceGroupConfiguration { + /** + * Specifies the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents + * the configuration of the resource group managed by Azure. + * + *

The configuration of the managed resource group associated with the resource.. + * + * @param managedResourceGroupConfiguration ManagedResourceGroupConfiguration represents the configuration + * of the resource group managed by Azure. + *

The configuration of the managed resource group associated with the resource. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupConfiguration( + ManagedResourceGroupConfiguration managedResourceGroupConfiguration); + } + /** The stage of the ClusterManager definition allowing to specify vmSize. */ + interface WithVmSize { + /** + * Specifies the vmSize property: Field deprecated, this value will no longer influence the cluster manager + * allocation process and will be removed in a future version. The size of the Azure virtual machines to use + * for hosting the cluster manager resource.. + * + * @param vmSize Field deprecated, this value will no longer influence the cluster manager allocation + * process and will be removed in a future version. The size of the Azure virtual machines to use for + * hosting the cluster manager resource. + * @return the next definition stage. + */ + WithCreate withVmSize(String vmSize); + } + } + /** + * Begins update for the ClusterManager resource. + * + * @return the stage of resource update. + */ + ClusterManager.Update update(); + + /** The template for ClusterManager update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ClusterManager apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ClusterManager apply(Context context); + } + /** The ClusterManager update stages. */ + interface UpdateStages { + /** The stage of the ClusterManager update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ClusterManager refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ClusterManager refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.java new file mode 100644 index 000000000000..ca0ae8686e85 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerConnectionStatus.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The latest connectivity status between cluster manager and the cluster. */ +public final class ClusterManagerConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for ClusterManagerConnectionStatus. */ + public static final ClusterManagerConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Unreachable for ClusterManagerConnectionStatus. */ + public static final ClusterManagerConnectionStatus UNREACHABLE = fromString("Unreachable"); + + /** + * Creates a new instance of ClusterManagerConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterManagerConnectionStatus() { + } + + /** + * Creates or finds a ClusterManagerConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterManagerConnectionStatus. + */ + @JsonCreator + public static ClusterManagerConnectionStatus fromString(String name) { + return fromString(name, ClusterManagerConnectionStatus.class); + } + + /** + * Gets known ClusterManagerConnectionStatus values. + * + * @return known ClusterManagerConnectionStatus values. + */ + public static Collection values() { + return values(ClusterManagerConnectionStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java new file mode 100644 index 000000000000..da7035976e3b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerDetailedStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The detailed status that provides additional information about the cluster manager. */ +public final class ClusterManagerDetailedStatus extends ExpandableStringEnum { + /** Static value Error for ClusterManagerDetailedStatus. */ + public static final ClusterManagerDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for ClusterManagerDetailedStatus. */ + public static final ClusterManagerDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for ClusterManagerDetailedStatus. */ + public static final ClusterManagerDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** Static value ProvisioningFailed for ClusterManagerDetailedStatus. */ + public static final ClusterManagerDetailedStatus PROVISIONING_FAILED = fromString("ProvisioningFailed"); + + /** Static value Updating for ClusterManagerDetailedStatus. */ + public static final ClusterManagerDetailedStatus UPDATING = fromString("Updating"); + + /** Static value UpdateFailed for ClusterManagerDetailedStatus. */ + public static final ClusterManagerDetailedStatus UPDATE_FAILED = fromString("UpdateFailed"); + + /** + * Creates a new instance of ClusterManagerDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterManagerDetailedStatus() { + } + + /** + * Creates or finds a ClusterManagerDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterManagerDetailedStatus. + */ + @JsonCreator + public static ClusterManagerDetailedStatus fromString(String name) { + return fromString(name, ClusterManagerDetailedStatus.class); + } + + /** + * Gets known ClusterManagerDetailedStatus values. + * + * @return known ClusterManagerDetailedStatus values. + */ + public static Collection values() { + return values(ClusterManagerDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java new file mode 100644 index 000000000000..43391369cc54 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterManagerList represents a list of cluster manager objects. */ +@Fluent +public final class ClusterManagerList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of cluster managers. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ClusterManagerList class. */ + public ClusterManagerList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ClusterManagerList object itself. + */ + public ClusterManagerList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of cluster managers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cluster managers. + * + * @param value the value value to set. + * @return the ClusterManagerList object itself. + */ + public ClusterManagerList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java new file mode 100644 index 000000000000..301e4afb633d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerPatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. */ +@Fluent +public final class ClusterManagerPatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ClusterManagerPatchParameters class. */ + public ClusterManagerPatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the ClusterManagerPatchParameters object itself. + */ + public ClusterManagerPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java new file mode 100644 index 000000000000..dcc182b593c6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagerProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the cluster manager. */ +public final class ClusterManagerProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ClusterManagerProvisioningState. */ + public static final ClusterManagerProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ClusterManagerProvisioningState. */ + public static final ClusterManagerProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ClusterManagerProvisioningState. */ + public static final ClusterManagerProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for ClusterManagerProvisioningState. */ + public static final ClusterManagerProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for ClusterManagerProvisioningState. */ + public static final ClusterManagerProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Updating for ClusterManagerProvisioningState. */ + public static final ClusterManagerProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of ClusterManagerProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterManagerProvisioningState() { + } + + /** + * Creates or finds a ClusterManagerProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterManagerProvisioningState. + */ + @JsonCreator + public static ClusterManagerProvisioningState fromString(String name) { + return fromString(name, ClusterManagerProvisioningState.class); + } + + /** + * Gets known ClusterManagerProvisioningState values. + * + * @return known ClusterManagerProvisioningState values. + */ + public static Collection values() { + return values(ClusterManagerProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java new file mode 100644 index 000000000000..5c58504e9afb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterManagers.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ClusterManagers. */ +public interface ClusterManagers { + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List cluster managers in the subscription. + * + *

Get a list of cluster managers in the provided subscription. + * + * @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 a list of cluster managers in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cluster managers in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List cluster managers in the resource group. + * + *

Get a list of cluster managers in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of cluster managers in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterManagerName, Context context); + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 properties of the provided cluster manager. + */ + ClusterManager getByResourceGroup(String resourceGroupName, String clusterManagerName); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 deleteByResourceGroup(String resourceGroupName, String clusterManagerName); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterManagerName The name of the cluster manager. + * @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 delete(String resourceGroupName, String clusterManagerName, Context context); + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param id the resource ID. + * @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 properties of the provided cluster manager along with {@link Response}. + */ + ClusterManager getById(String id); + + /** + * Retrieve the cluster manager. + * + *

Get the properties of the provided cluster manager. + * + * @param id the resource ID. + * @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 properties of the provided cluster manager along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the cluster manager. + * + *

Delete the provided cluster manager. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ClusterManager resource. + * + * @param name resource name. + * @return the first stage of the new ClusterManager definition. + */ + ClusterManager.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java new file mode 100644 index 000000000000..44aaff6ec89d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfiguration.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ClusterMetricsConfiguration. */ +public interface ClusterMetricsConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @return the collectionInterval value. + */ + long collectionInterval(); + + /** + * Gets the detailedStatus property: The more detailed status of the metrics configuration. + * + * @return the detailedStatus value. + */ + ClusterMetricsConfigurationDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the disabledMetrics property: The list of metrics that are available for the cluster but disabled at the + * moment. + * + * @return the disabledMetrics value. + */ + List disabledMetrics(); + + /** + * Gets the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @return the enabledMetrics value. + */ + List enabledMetrics(); + + /** + * Gets the provisioningState property: The provisioning state of the metrics configuration. + * + * @return the provisioningState value. + */ + ClusterMetricsConfigurationProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner object. + * + * @return the inner object. + */ + ClusterMetricsConfigurationInner innerModel(); + + /** The entirety of the ClusterMetricsConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithCollectionInterval, + DefinitionStages.WithCreate { + } + /** The ClusterMetricsConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the ClusterMetricsConfiguration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ClusterMetricsConfiguration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the ClusterMetricsConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithExtendedLocation withExistingCluster(String resourceGroupName, String clusterName); + } + /** The stage of the ClusterMetricsConfiguration definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithCollectionInterval withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the ClusterMetricsConfiguration definition allowing to specify collectionInterval. */ + interface WithCollectionInterval { + /** + * Specifies the collectionInterval property: The interval in minutes by which metrics will be collected.. + * + * @param collectionInterval The interval in minutes by which metrics will be collected. + * @return the next definition stage. + */ + WithCreate withCollectionInterval(long collectionInterval); + } + /** + * The stage of the ClusterMetricsConfiguration 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.WithTags, DefinitionStages.WithEnabledMetrics { + /** + * Executes the create request. + * + * @return the created resource. + */ + ClusterMetricsConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ClusterMetricsConfiguration create(Context context); + } + /** The stage of the ClusterMetricsConfiguration definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ClusterMetricsConfiguration definition allowing to specify enabledMetrics. */ + interface WithEnabledMetrics { + /** + * Specifies the enabledMetrics property: The list of metric names that have been chosen to be enabled in + * addition to the core set of enabled metrics.. + * + * @param enabledMetrics The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * @return the next definition stage. + */ + WithCreate withEnabledMetrics(List enabledMetrics); + } + } + /** + * Begins update for the ClusterMetricsConfiguration resource. + * + * @return the stage of resource update. + */ + ClusterMetricsConfiguration.Update update(); + + /** The template for ClusterMetricsConfiguration update. */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithCollectionInterval, UpdateStages.WithEnabledMetrics { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ClusterMetricsConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ClusterMetricsConfiguration apply(Context context); + } + /** The ClusterMetricsConfiguration update stages. */ + interface UpdateStages { + /** The stage of the ClusterMetricsConfiguration update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ClusterMetricsConfiguration update allowing to specify collectionInterval. */ + interface WithCollectionInterval { + /** + * Specifies the collectionInterval property: The interval in minutes by which metrics will be collected.. + * + * @param collectionInterval The interval in minutes by which metrics will be collected. + * @return the next definition stage. + */ + Update withCollectionInterval(Long collectionInterval); + } + /** The stage of the ClusterMetricsConfiguration update allowing to specify enabledMetrics. */ + interface WithEnabledMetrics { + /** + * Specifies the enabledMetrics property: The list of metric names that have been chosen to be enabled in + * addition to the core set of enabled metrics.. + * + * @param enabledMetrics The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * @return the next definition stage. + */ + Update withEnabledMetrics(List enabledMetrics); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ClusterMetricsConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ClusterMetricsConfiguration refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java new file mode 100644 index 000000000000..609ffdacec59 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationDetailedStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the metrics configuration. */ +public final class ClusterMetricsConfigurationDetailedStatus + extends ExpandableStringEnum { + /** Static value Processing for ClusterMetricsConfigurationDetailedStatus. */ + public static final ClusterMetricsConfigurationDetailedStatus PROCESSING = fromString("Processing"); + + /** Static value Applied for ClusterMetricsConfigurationDetailedStatus. */ + public static final ClusterMetricsConfigurationDetailedStatus APPLIED = fromString("Applied"); + + /** Static value Error for ClusterMetricsConfigurationDetailedStatus. */ + public static final ClusterMetricsConfigurationDetailedStatus ERROR = fromString("Error"); + + /** + * Creates a new instance of ClusterMetricsConfigurationDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterMetricsConfigurationDetailedStatus() { + } + + /** + * Creates or finds a ClusterMetricsConfigurationDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterMetricsConfigurationDetailedStatus. + */ + @JsonCreator + public static ClusterMetricsConfigurationDetailedStatus fromString(String name) { + return fromString(name, ClusterMetricsConfigurationDetailedStatus.class); + } + + /** + * Gets known ClusterMetricsConfigurationDetailedStatus values. + * + * @return known ClusterMetricsConfigurationDetailedStatus values. + */ + public static Collection values() { + return values(ClusterMetricsConfigurationDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java new file mode 100644 index 000000000000..b10e0e279bb3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. */ +@Fluent +public final class ClusterMetricsConfigurationList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of metrics configurations. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ClusterMetricsConfigurationList class. */ + public ClusterMetricsConfigurationList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ClusterMetricsConfigurationList object itself. + */ + public ClusterMetricsConfigurationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of metrics configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of metrics configurations. + * + * @param value the value value to set. + * @return the ClusterMetricsConfigurationList object itself. + */ + public ClusterMetricsConfigurationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.java new file mode 100644 index 000000000000..97f8a29fb74a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationPatchParameters.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.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterMetricsConfigurationPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of + * cluster. + */ +@Fluent +public final class ClusterMetricsConfigurationPatchParameters { + /* + * ClusterMetricsConfigurationPatchProperties represents the properties of metrics configuration for the cluster + * for patching. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private ClusterMetricsConfigurationPatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ClusterMetricsConfigurationPatchParameters class. */ + public ClusterMetricsConfigurationPatchParameters() { + } + + /** + * Get the innerProperties property: ClusterMetricsConfigurationPatchProperties represents the properties of metrics + * configuration for the cluster for patching. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ClusterMetricsConfigurationPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the ClusterMetricsConfigurationPatchParameters object itself. + */ + public ClusterMetricsConfigurationPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @return the collectionInterval value. + */ + public Long collectionInterval() { + return this.innerProperties() == null ? null : this.innerProperties().collectionInterval(); + } + + /** + * Set the collectionInterval property: The interval in minutes by which metrics will be collected. + * + * @param collectionInterval the collectionInterval value to set. + * @return the ClusterMetricsConfigurationPatchParameters object itself. + */ + public ClusterMetricsConfigurationPatchParameters withCollectionInterval(Long collectionInterval) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterMetricsConfigurationPatchProperties(); + } + this.innerProperties().withCollectionInterval(collectionInterval); + return this; + } + + /** + * Get the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @return the enabledMetrics value. + */ + public List enabledMetrics() { + return this.innerProperties() == null ? null : this.innerProperties().enabledMetrics(); + } + + /** + * Set the enabledMetrics property: The list of metric names that have been chosen to be enabled in addition to the + * core set of enabled metrics. + * + * @param enabledMetrics the enabledMetrics value to set. + * @return the ClusterMetricsConfigurationPatchParameters object itself. + */ + public ClusterMetricsConfigurationPatchParameters withEnabledMetrics(List enabledMetrics) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterMetricsConfigurationPatchProperties(); + } + this.innerProperties().withEnabledMetrics(enabledMetrics); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java new file mode 100644 index 000000000000..a4b39e12edab --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterMetricsConfigurationProvisioningState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the metrics configuration. */ +public final class ClusterMetricsConfigurationProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for ClusterMetricsConfigurationProvisioningState. */ + public static final ClusterMetricsConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ClusterMetricsConfigurationProvisioningState. */ + public static final ClusterMetricsConfigurationProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ClusterMetricsConfigurationProvisioningState. */ + public static final ClusterMetricsConfigurationProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Accepted for ClusterMetricsConfigurationProvisioningState. */ + public static final ClusterMetricsConfigurationProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Provisioning for ClusterMetricsConfigurationProvisioningState. */ + public static final ClusterMetricsConfigurationProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of ClusterMetricsConfigurationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterMetricsConfigurationProvisioningState() { + } + + /** + * Creates or finds a ClusterMetricsConfigurationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterMetricsConfigurationProvisioningState. + */ + @JsonCreator + public static ClusterMetricsConfigurationProvisioningState fromString(String name) { + return fromString(name, ClusterMetricsConfigurationProvisioningState.class); + } + + /** + * Gets known ClusterMetricsConfigurationProvisioningState values. + * + * @return known ClusterMetricsConfigurationProvisioningState values. + */ + public static Collection values() { + return values(ClusterMetricsConfigurationProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java new file mode 100644 index 000000000000..d330b36ced05 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterPatchParameters.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ClusterPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** ClusterPatchParameters represents the body of the request to patch the cluster properties. */ +@Fluent +public final class ClusterPatchParameters { + /* + * ClusterPatchProperties represents the properties of the cluster for patching. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private ClusterPatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ClusterPatchParameters class. */ + public ClusterPatchParameters() { + } + + /** + * Get the innerProperties property: ClusterPatchProperties represents the properties of the cluster for patching. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ClusterPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @return the aggregatorOrSingleRackDefinition value. + */ + public RackDefinition aggregatorOrSingleRackDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().aggregatorOrSingleRackDefinition(); + } + + /** + * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack. + * + *

The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator + * rack in a multi-rack cluster. + * + * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withAggregatorOrSingleRackDefinition( + RackDefinition aggregatorOrSingleRackDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withAggregatorOrSingleRackDefinition(aggregatorOrSingleRackDefinition); + return this; + } + + /** + * Get the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @return the clusterLocation value. + */ + public String clusterLocation() { + return this.innerProperties() == null ? null : this.innerProperties().clusterLocation(); + } + + /** + * Set the clusterLocation property: The customer-provided location information to identify where the cluster + * resides. + * + * @param clusterLocation the clusterLocation value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withClusterLocation(String clusterLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withClusterLocation(clusterLocation); + return this; + } + + /** + * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @return the clusterServicePrincipal value. + */ + public ServicePrincipalInformation clusterServicePrincipal() { + return this.innerProperties() == null ? null : this.innerProperties().clusterServicePrincipal(); + } + + /** + * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service + * principal to be used by the cluster during Arc Appliance installation. + * + *

The service principal to be used by the cluster during Arc Appliance installation. + * + * @param clusterServicePrincipal the clusterServicePrincipal value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withClusterServicePrincipal(clusterServicePrincipal); + return this; + } + + /** + * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @return the computeDeploymentThreshold value. + */ + public ValidationThreshold computeDeploymentThreshold() { + return this.innerProperties() == null ? null : this.innerProperties().computeDeploymentThreshold(); + } + + /** + * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and + * deployment failures. + * + *

The validation threshold indicating the allowable failures of compute machines during environment validation + * and deployment. + * + * @param computeDeploymentThreshold the computeDeploymentThreshold value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withComputeDeploymentThreshold(computeDeploymentThreshold); + return this; + } + + /** + * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @return the computeRackDefinitions value. + */ + public List computeRackDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().computeRackDefinitions(); + } + + /** + * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack + * cluster, or an empty list in a single-rack cluster. + * + * @param computeRackDefinitions the computeRackDefinitions value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withComputeRackDefinitions(List computeRackDefinitions) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withComputeRackDefinitions(computeRackDefinitions); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java new file mode 100644 index 000000000000..fbe1d66629da --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the cluster. */ +public final class ClusterProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ClusterProvisioningState. */ + public static final ClusterProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ClusterProvisioningState. */ + public static final ClusterProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ClusterProvisioningState. */ + public static final ClusterProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Accepted for ClusterProvisioningState. */ + public static final ClusterProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Validating for ClusterProvisioningState. */ + public static final ClusterProvisioningState VALIDATING = fromString("Validating"); + + /** Static value Updating for ClusterProvisioningState. */ + public static final ClusterProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of ClusterProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterProvisioningState() { + } + + /** + * Creates or finds a ClusterProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterProvisioningState. + */ + @JsonCreator + public static ClusterProvisioningState fromString(String name) { + return fromString(name, ClusterProvisioningState.class); + } + + /** + * Gets known ClusterProvisioningState values. + * + * @return known ClusterProvisioningState values. + */ + public static Collection values() { + return values(ClusterProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.java new file mode 100644 index 000000000000..00746e9e80a7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of rack configuration for the cluster. */ +public final class ClusterType extends ExpandableStringEnum { + /** Static value SingleRack for ClusterType. */ + public static final ClusterType SINGLE_RACK = fromString("SingleRack"); + + /** Static value MultiRack for ClusterType. */ + public static final ClusterType MULTI_RACK = fromString("MultiRack"); + + /** + * Creates a new instance of ClusterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterType() { + } + + /** + * Creates or finds a ClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterType. + */ + @JsonCreator + public static ClusterType fromString(String name) { + return fromString(name, ClusterType.class); + } + + /** + * Gets known ClusterType values. + * + * @return known ClusterType values. + */ + public static Collection values() { + return values(ClusterType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java new file mode 100644 index 000000000000..5540f59bdb80 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ClusterUpdateVersionParameters.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ClusterUpdateVersionParameters represents the body of the request to update cluster version. */ +@Fluent +public final class ClusterUpdateVersionParameters { + /* + * The version to be applied to the cluster during update. + */ + @JsonProperty(value = "targetClusterVersion", required = true) + private String targetClusterVersion; + + /** Creates an instance of ClusterUpdateVersionParameters class. */ + public ClusterUpdateVersionParameters() { + } + + /** + * Get the targetClusterVersion property: The version to be applied to the cluster during update. + * + * @return the targetClusterVersion value. + */ + public String targetClusterVersion() { + return this.targetClusterVersion; + } + + /** + * Set the targetClusterVersion property: The version to be applied to the cluster during update. + * + * @param targetClusterVersion the targetClusterVersion value to set. + * @return the ClusterUpdateVersionParameters object itself. + */ + public ClusterUpdateVersionParameters withTargetClusterVersion(String targetClusterVersion) { + this.targetClusterVersion = targetClusterVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetClusterVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetClusterVersion in model ClusterUpdateVersionParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterUpdateVersionParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java new file mode 100644 index 000000000000..cead4c77c0f6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Clusters.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Clusters. */ +public interface Clusters { + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List clusters in the subscription. + * + *

Get a list of clusters in the provided subscription. + * + * @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 a list of clusters in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of clusters in the provided resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List clusters in the resource group. + * + *

Get a list of clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of clusters in the provided resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the cluster. + * + *

Get properties of the provided 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 properties of the provided cluster. + */ + Cluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete the cluster. + * + *

Delete the provided 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. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete the cluster. + * + *

Delete the provided 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. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @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. + */ + void deploy(String resourceGroupName, String clusterName); + + /** + * Deploy the cluster to the rack. + * + *

Deploy the cluster to the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterDeployParameters The request body. + * @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 deploy( + String resourceGroupName, String clusterName, ClusterDeployParameters clusterDeployParameters, Context context); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion( + String resourceGroupName, String clusterName, ClusterUpdateVersionParameters clusterUpdateVersionParameters); + + /** + * Update the cluster version. + * + *

Update the version of the provided cluster to one of the available supported versions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param clusterUpdateVersionParameters The request body. + * @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 updateVersion( + String resourceGroupName, + String clusterName, + ClusterUpdateVersionParameters clusterUpdateVersionParameters, + Context context); + + /** + * Retrieve the cluster. + * + *

Get properties of the provided cluster. + * + * @param id the resource ID. + * @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 properties of the provided cluster along with {@link Response}. + */ + Cluster getById(String id); + + /** + * Retrieve the cluster. + * + *

Get properties of the provided cluster. + * + * @param id the resource ID. + * @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 properties of the provided cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the cluster. + * + *

Delete the provided cluster. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the cluster. + * + *

Delete the provided cluster. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CniBgpConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CniBgpConfiguration.java new file mode 100644 index 000000000000..891a66b2392e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CniBgpConfiguration.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CniBgpConfiguration represents the Calico BGP configuration. */ +@Fluent +public final class CniBgpConfiguration { + /* + * The list of BgpPeer entities that the Hybrid AKS cluster will peer with in addition to peering that occurs + * automatically with the switch fabric. + */ + @JsonProperty(value = "bgpPeers") + private List bgpPeers; + + /* + * The list of prefix community advertisement properties. Each prefix community specifies a prefix, and the + * communities that should be associated with that prefix when it is announced. + */ + @JsonProperty(value = "communityAdvertisements") + private List communityAdvertisements; + + /* + * The password of the Calico node mesh. It defaults to a randomly-generated string when not provided. + */ + @JsonProperty(value = "nodeMeshPassword") + private String nodeMeshPassword; + + /* + * The subnet blocks in CIDR format for Kubernetes service external IPs to be advertised over BGP. + */ + @JsonProperty(value = "serviceExternalPrefixes") + private List serviceExternalPrefixes; + + /* + * The subnet blocks in CIDR format for Kubernetes load balancers. Load balancer IPs will only be advertised if + * they + * are within one of these blocks. + */ + @JsonProperty(value = "serviceLoadBalancerPrefixes") + private List serviceLoadBalancerPrefixes; + + /** Creates an instance of CniBgpConfiguration class. */ + public CniBgpConfiguration() { + } + + /** + * Get the bgpPeers property: The list of BgpPeer entities that the Hybrid AKS cluster will peer with in addition to + * peering that occurs automatically with the switch fabric. + * + * @return the bgpPeers value. + */ + public List bgpPeers() { + return this.bgpPeers; + } + + /** + * Set the bgpPeers property: The list of BgpPeer entities that the Hybrid AKS cluster will peer with in addition to + * peering that occurs automatically with the switch fabric. + * + * @param bgpPeers the bgpPeers value to set. + * @return the CniBgpConfiguration object itself. + */ + public CniBgpConfiguration withBgpPeers(List bgpPeers) { + this.bgpPeers = bgpPeers; + return this; + } + + /** + * Get the communityAdvertisements property: The list of prefix community advertisement properties. Each prefix + * community specifies a prefix, and the communities that should be associated with that prefix when it is + * announced. + * + * @return the communityAdvertisements value. + */ + public List communityAdvertisements() { + return this.communityAdvertisements; + } + + /** + * Set the communityAdvertisements property: The list of prefix community advertisement properties. Each prefix + * community specifies a prefix, and the communities that should be associated with that prefix when it is + * announced. + * + * @param communityAdvertisements the communityAdvertisements value to set. + * @return the CniBgpConfiguration object itself. + */ + public CniBgpConfiguration withCommunityAdvertisements(List communityAdvertisements) { + this.communityAdvertisements = communityAdvertisements; + return this; + } + + /** + * Get the nodeMeshPassword property: The password of the Calico node mesh. It defaults to a randomly-generated + * string when not provided. + * + * @return the nodeMeshPassword value. + */ + public String nodeMeshPassword() { + return this.nodeMeshPassword; + } + + /** + * Set the nodeMeshPassword property: The password of the Calico node mesh. It defaults to a randomly-generated + * string when not provided. + * + * @param nodeMeshPassword the nodeMeshPassword value to set. + * @return the CniBgpConfiguration object itself. + */ + public CniBgpConfiguration withNodeMeshPassword(String nodeMeshPassword) { + this.nodeMeshPassword = nodeMeshPassword; + return this; + } + + /** + * Get the serviceExternalPrefixes property: The subnet blocks in CIDR format for Kubernetes service external IPs to + * be advertised over BGP. + * + * @return the serviceExternalPrefixes value. + */ + public List serviceExternalPrefixes() { + return this.serviceExternalPrefixes; + } + + /** + * Set the serviceExternalPrefixes property: The subnet blocks in CIDR format for Kubernetes service external IPs to + * be advertised over BGP. + * + * @param serviceExternalPrefixes the serviceExternalPrefixes value to set. + * @return the CniBgpConfiguration object itself. + */ + public CniBgpConfiguration withServiceExternalPrefixes(List serviceExternalPrefixes) { + this.serviceExternalPrefixes = serviceExternalPrefixes; + return this; + } + + /** + * Get the serviceLoadBalancerPrefixes property: The subnet blocks in CIDR format for Kubernetes load balancers. + * Load balancer IPs will only be advertised if they are within one of these blocks. + * + * @return the serviceLoadBalancerPrefixes value. + */ + public List serviceLoadBalancerPrefixes() { + return this.serviceLoadBalancerPrefixes; + } + + /** + * Set the serviceLoadBalancerPrefixes property: The subnet blocks in CIDR format for Kubernetes load balancers. + * Load balancer IPs will only be advertised if they are within one of these blocks. + * + * @param serviceLoadBalancerPrefixes the serviceLoadBalancerPrefixes value to set. + * @return the CniBgpConfiguration object itself. + */ + public CniBgpConfiguration withServiceLoadBalancerPrefixes(List serviceLoadBalancerPrefixes) { + this.serviceLoadBalancerPrefixes = serviceLoadBalancerPrefixes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bgpPeers() != null) { + bgpPeers().forEach(e -> e.validate()); + } + if (communityAdvertisements() != null) { + communityAdvertisements().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommunityAdvertisement.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommunityAdvertisement.java new file mode 100644 index 000000000000..33cbcce66298 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/CommunityAdvertisement.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CommunityAdvertisement represents the prefix and the communities that should be associated with that prefix. */ +@Fluent +public final class CommunityAdvertisement { + /* + * The list of community strings to announce with this prefix. + */ + @JsonProperty(value = "communities", required = true) + private List communities; + + /* + * The subnet in CIDR format for which properties should be advertised. + */ + @JsonProperty(value = "subnetPrefix", required = true) + private String subnetPrefix; + + /** Creates an instance of CommunityAdvertisement class. */ + public CommunityAdvertisement() { + } + + /** + * Get the communities property: The list of community strings to announce with this prefix. + * + * @return the communities value. + */ + public List communities() { + return this.communities; + } + + /** + * Set the communities property: The list of community strings to announce with this prefix. + * + * @param communities the communities value to set. + * @return the CommunityAdvertisement object itself. + */ + public CommunityAdvertisement withCommunities(List communities) { + this.communities = communities; + return this; + } + + /** + * Get the subnetPrefix property: The subnet in CIDR format for which properties should be advertised. + * + * @return the subnetPrefix value. + */ + public String subnetPrefix() { + return this.subnetPrefix; + } + + /** + * Set the subnetPrefix property: The subnet in CIDR format for which properties should be advertised. + * + * @param subnetPrefix the subnetPrefix value to set. + * @return the CommunityAdvertisement object itself. + */ + public CommunityAdvertisement withSubnetPrefix(String subnetPrefix) { + this.subnetPrefix = subnetPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (communities() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property communities in model CommunityAdvertisement")); + } + if (subnetPrefix() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetPrefix in model CommunityAdvertisement")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommunityAdvertisement.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java new file mode 100644 index 000000000000..ceb3df7398ca --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Console.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of Console. */ +public interface Console { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster manager associated with the cluster this virtual machine is created on. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the detailedStatus property: The more detailed status of the console. + * + * @return the detailedStatus value. + */ + ConsoleDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the enabled property: The indicator of whether the console access is enabled. + * + * @return the enabled value. + */ + ConsoleEnabled enabled(); + + /** + * Gets the expiration property: The date and time after which the key will be disallowed access. + * + * @return the expiration value. + */ + OffsetDateTime expiration(); + + /** + * Gets the privateLinkServiceId property: The resource ID of the private link service that is used to provide + * virtual machine console access. + * + * @return the privateLinkServiceId value. + */ + String privateLinkServiceId(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual machine console. + * + * @return the provisioningState value. + */ + ConsoleProvisioningState provisioningState(); + + /** + * Gets the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @return the sshPublicKey value. + */ + SshPublicKey sshPublicKey(); + + /** + * Gets the virtualMachineAccessId property: The unique identifier for the virtual machine that is used to access + * the console. + * + * @return the virtualMachineAccessId value. + */ + String virtualMachineAccessId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner object. + * + * @return the inner object. + */ + ConsoleInner innerModel(); + + /** The entirety of the Console definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithEnabled, + DefinitionStages.WithSshPublicKey, + DefinitionStages.WithCreate { + } + /** The Console definition stages. */ + interface DefinitionStages { + /** The first stage of the Console definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Console definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Console definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualMachineName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @return the next definition stage. + */ + WithExtendedLocation withExistingVirtualMachine(String resourceGroupName, String virtualMachineName); + } + /** The stage of the Console definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster manager associated with the cluster this virtual machine is + * created on.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster manager associated with the cluster this virtual machine is + * created on. + * @return the next definition stage. + */ + WithEnabled withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Console definition allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: The indicator of whether the console access is enabled.. + * + * @param enabled The indicator of whether the console access is enabled. + * @return the next definition stage. + */ + WithSshPublicKey withEnabled(ConsoleEnabled enabled); + } + /** The stage of the Console definition allowing to specify sshPublicKey. */ + interface WithSshPublicKey { + /** + * Specifies the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the + * virtual machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the + * corresponding SSH private key for logging in.. + * + * @param sshPublicKey SshPublicKey represents the public key used to authenticate with the virtual machine + * through SSH. + *

The SSH public key that will be provisioned for user access. The user is expected to have the + * corresponding SSH private key for logging in. + * @return the next definition stage. + */ + WithCreate withSshPublicKey(SshPublicKey sshPublicKey); + } + /** + * The stage of the Console 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.WithTags, DefinitionStages.WithExpiration { + /** + * Executes the create request. + * + * @return the created resource. + */ + Console create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Console create(Context context); + } + /** The stage of the Console definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Console definition allowing to specify expiration. */ + interface WithExpiration { + /** + * Specifies the expiration property: The date and time after which the key will be disallowed access.. + * + * @param expiration The date and time after which the key will be disallowed access. + * @return the next definition stage. + */ + WithCreate withExpiration(OffsetDateTime expiration); + } + } + /** + * Begins update for the Console resource. + * + * @return the stage of resource update. + */ + Console.Update update(); + + /** The template for Console update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithEnabled, + UpdateStages.WithExpiration, + UpdateStages.WithSshPublicKey { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Console apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Console apply(Context context); + } + /** The Console update stages. */ + interface UpdateStages { + /** The stage of the Console update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Console update allowing to specify enabled. */ + interface WithEnabled { + /** + * Specifies the enabled property: The credentials used to login to the image repository that has access to + * the specified image.. + * + * @param enabled The credentials used to login to the image repository that has access to the specified + * image. + * @return the next definition stage. + */ + Update withEnabled(ConsoleEnabled enabled); + } + /** The stage of the Console update allowing to specify expiration. */ + interface WithExpiration { + /** + * Specifies the expiration property: The date and time after which the key will be disallowed access.. + * + * @param expiration The date and time after which the key will be disallowed access. + * @return the next definition stage. + */ + Update withExpiration(OffsetDateTime expiration); + } + /** The stage of the Console update allowing to specify sshPublicKey. */ + interface WithSshPublicKey { + /** + * Specifies the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the + * virtual machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the + * corresponding SSH private key for logging in.. + * + * @param sshPublicKey SshPublicKey represents the public key used to authenticate with the virtual machine + * through SSH. + *

The SSH public key that will be provisioned for user access. The user is expected to have the + * corresponding SSH private key for logging in. + * @return the next definition stage. + */ + Update withSshPublicKey(SshPublicKey sshPublicKey); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Console refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Console refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.java new file mode 100644 index 000000000000..d1d7904fb1e4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleDetailedStatus.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the console. */ +public final class ConsoleDetailedStatus extends ExpandableStringEnum { + /** Static value Ready for ConsoleDetailedStatus. */ + public static final ConsoleDetailedStatus READY = fromString("Ready"); + + /** Static value Error for ConsoleDetailedStatus. */ + public static final ConsoleDetailedStatus ERROR = fromString("Error"); + + /** + * Creates a new instance of ConsoleDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConsoleDetailedStatus() { + } + + /** + * Creates or finds a ConsoleDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConsoleDetailedStatus. + */ + @JsonCreator + public static ConsoleDetailedStatus fromString(String name) { + return fromString(name, ConsoleDetailedStatus.class); + } + + /** + * Gets known ConsoleDetailedStatus values. + * + * @return known ConsoleDetailedStatus values. + */ + public static Collection values() { + return values(ConsoleDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.java new file mode 100644 index 000000000000..8809bc4724f6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleEnabled.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The credentials used to login to the image repository that has access to the specified image. */ +public final class ConsoleEnabled extends ExpandableStringEnum { + /** Static value True for ConsoleEnabled. */ + public static final ConsoleEnabled TRUE = fromString("True"); + + /** Static value False for ConsoleEnabled. */ + public static final ConsoleEnabled FALSE = fromString("False"); + + /** + * Creates a new instance of ConsoleEnabled value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConsoleEnabled() { + } + + /** + * Creates or finds a ConsoleEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConsoleEnabled. + */ + @JsonCreator + public static ConsoleEnabled fromString(String name) { + return fromString(name, ConsoleEnabled.class); + } + + /** + * Gets known ConsoleEnabled values. + * + * @return known ConsoleEnabled values. + */ + public static Collection values() { + return values(ConsoleEnabled.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java new file mode 100644 index 000000000000..0682b983fdf0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ConsoleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ConsoleList represents a list of virtual machine consoles. */ +@Fluent +public final class ConsoleList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of virtual machine consoles. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ConsoleList class. */ + public ConsoleList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the ConsoleList object itself. + */ + public ConsoleList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of virtual machine consoles. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machine consoles. + * + * @param value the value value to set. + * @return the ConsoleList object itself. + */ + public ConsoleList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java new file mode 100644 index 000000000000..cbdbce0210eb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsolePatchParameters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.ConsolePatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** ConsolePatchParameters represents the body of the request to patch the virtual machine console. */ +@Fluent +public final class ConsolePatchParameters { + /* + * ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private ConsolePatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ConsolePatchParameters class. */ + public ConsolePatchParameters() { + } + + /** + * Get the innerProperties property: ConsolePatchProperties represents the properties of the virtual machine console + * that can be patched. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private ConsolePatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the ConsolePatchParameters object itself. + */ + public ConsolePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the enabled property: The credentials used to login to the image repository that has access to the specified + * image. + * + * @return the enabled value. + */ + public ConsoleEnabled enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: The credentials used to login to the image repository that has access to the specified + * image. + * + * @param enabled the enabled value to set. + * @return the ConsolePatchParameters object itself. + */ + public ConsolePatchParameters withEnabled(ConsoleEnabled enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsolePatchProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the expiration property: The date and time after which the key will be disallowed access. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: The date and time after which the key will be disallowed access. + * + * @param expiration the expiration value to set. + * @return the ConsolePatchParameters object itself. + */ + public ConsolePatchParameters withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsolePatchProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @return the sshPublicKey value. + */ + public SshPublicKey sshPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().sshPublicKey(); + } + + /** + * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key that will be provisioned for user access. The user is expected to have the corresponding + * SSH private key for logging in. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the ConsolePatchParameters object itself. + */ + public ConsolePatchParameters withSshPublicKey(SshPublicKey sshPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ConsolePatchProperties(); + } + this.innerProperties().withSshPublicKey(sshPublicKey); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java new file mode 100644 index 000000000000..1c2ea1004c4f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ConsoleProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the virtual machine console. */ +public final class ConsoleProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ConsoleProvisioningState. */ + public static final ConsoleProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ConsoleProvisioningState. */ + public static final ConsoleProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ConsoleProvisioningState. */ + public static final ConsoleProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for ConsoleProvisioningState. */ + public static final ConsoleProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for ConsoleProvisioningState. */ + public static final ConsoleProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ConsoleProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConsoleProvisioningState() { + } + + /** + * Creates or finds a ConsoleProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConsoleProvisioningState. + */ + @JsonCreator + public static ConsoleProvisioningState fromString(String name) { + return fromString(name, ConsoleProvisioningState.class); + } + + /** + * Gets known ConsoleProvisioningState values. + * + * @return known ConsoleProvisioningState values. + */ + public static Collection values() { + return values(ConsoleProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java new file mode 100644 index 000000000000..4dbd81bb98a6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Consoles.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Consoles. */ +public interface Consoles { + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 a list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String virtualMachineName); + + /** + * List virtual machine consoles in the resource group. + * + *

Get a list of virtual machine consoles in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 a list of virtual machine consoles in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String virtualMachineName, String consoleName, Context context); + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 properties of the provided virtual machine console. + */ + Console get(String resourceGroupName, String virtualMachineName, String consoleName); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 delete(String resourceGroupName, String virtualMachineName, String consoleName); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param consoleName The name of the virtual machine console. + * @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 delete(String resourceGroupName, String virtualMachineName, String consoleName, Context context); + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param id the resource ID. + * @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 properties of the provided virtual machine console along with {@link Response}. + */ + Console getById(String id); + + /** + * Retrieve the virtual machine console. + * + *

Get properties of the provided virtual machine console. + * + * @param id the resource ID. + * @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 properties of the provided virtual machine console along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the virtual machine console. + * + *

Delete the provided virtual machine console. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Console resource. + * + * @param name resource name. + * @return the first stage of the new Console definition. + */ + Console.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.java new file mode 100644 index 000000000000..0b3153141a72 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ControlImpact.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the control plane will be impacted during the upgrade. */ +public final class ControlImpact extends ExpandableStringEnum { + /** Static value True for ControlImpact. */ + public static final ControlImpact TRUE = fromString("True"); + + /** Static value False for ControlImpact. */ + public static final ControlImpact FALSE = fromString("False"); + + /** + * Creates a new instance of ControlImpact value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ControlImpact() { + } + + /** + * Creates or finds a ControlImpact from its string representation. + * + * @param name a name to look for. + * @return the corresponding ControlImpact. + */ + @JsonCreator + public static ControlImpact fromString(String name) { + return fromString(name, ControlImpact.class); + } + + /** + * Gets known ControlImpact values. + * + * @return known ControlImpact values. + */ + public static Collection values() { + return values(ControlImpact.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetwork.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetwork.java new file mode 100644 index 000000000000..e15746e1eaf3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetwork.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.DefaultCniNetworkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DefaultCniNetwork. */ +public interface DefaultCniNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the clusterId property: The resource ID of the Network Cloud cluster this default CNI network is associated + * with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the cniAsNumber property: The autonomous system number that the fabric expects to peer with, derived from + * the associated L3 isolation domain. + * + * @return the cniAsNumber value. + */ + Long cniAsNumber(); + + /** + * Gets the cniBgpConfiguration property: CniBgpConfiguration represents the Calico BGP configuration. + * + *

The Calico BGP configuration. + * + * @return the cniBgpConfiguration value. + */ + CniBgpConfiguration cniBgpConfiguration(); + + /** + * Gets the detailedStatus property: The more detailed status of the default CNI network. + * + * @return the detailedStatus value. + */ + DefaultCniNetworkDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the fabricBgpPeers property: The L3 isolation fabric BGP peering connectivity information necessary for BGP + * peering the Hybrid AKS Cluster with the switch fabric. + * + * @return the fabricBgpPeers value. + */ + List fabricBgpPeers(); + + /** + * Gets the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource ID(s) that are + * associated with this default CNI network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + List hybridAksClustersAssociatedIds(); + + /** + * Gets the interfaceName property: The name of the interface that will be present in the virtual machine to + * represent this network. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the ipAllocationType property: The type of the IP address allocation. + * + * @return the ipAllocationType value. + */ + IpAllocationType ipAllocationType(); + + /** + * Gets the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this default CNI network. It is + * required when the IP allocation type is IPV4 or DualStack. + * + * @return the ipv4ConnectedPrefix value. + */ + String ipv4ConnectedPrefix(); + + /** + * Gets the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this default CNI network. It is + * required when the IP allocation type is IPV6 or DualStack. + * + * @return the ipv6ConnectedPrefix value. + */ + String ipv6ConnectedPrefix(); + + /** + * Gets the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @return the l3IsolationDomainId value. + */ + String l3IsolationDomainId(); + + /** + * Gets the provisioningState property: The provisioning state of the default CNI network. + * + * @return the provisioningState value. + */ + DefaultCniNetworkProvisioningState provisioningState(); + + /** + * Gets the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @return the vlan value. + */ + long vlan(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.DefaultCniNetworkInner object. + * + * @return the inner object. + */ + DefaultCniNetworkInner innerModel(); + + /** The entirety of the DefaultCniNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithL3IsolationDomainId, + DefinitionStages.WithVlan, + DefinitionStages.WithCreate { + } + /** The DefaultCniNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the DefaultCniNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DefaultCniNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DefaultCniNetwork definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the DefaultCniNetwork definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithL3IsolationDomainId withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the DefaultCniNetwork definition allowing to specify l3IsolationDomainId. */ + interface WithL3IsolationDomainId { + /** + * Specifies the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain.. + * + * @param l3IsolationDomainId The resource ID of the Network Fabric l3IsolationDomain. + * @return the next definition stage. + */ + WithVlan withL3IsolationDomainId(String l3IsolationDomainId); + } + /** The stage of the DefaultCniNetwork definition allowing to specify vlan. */ + interface WithVlan { + /** + * Specifies the vlan property: The VLAN from the l3IsolationDomain that is used for this network.. + * + * @param vlan The VLAN from the l3IsolationDomain that is used for this network. + * @return the next definition stage. + */ + WithCreate withVlan(long vlan); + } + /** + * The stage of the DefaultCniNetwork 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.WithTags, + DefinitionStages.WithCniBgpConfiguration, + DefinitionStages.WithIpAllocationType, + DefinitionStages.WithIpv4ConnectedPrefix, + DefinitionStages.WithIpv6ConnectedPrefix { + /** + * Executes the create request. + * + * @return the created resource. + */ + DefaultCniNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DefaultCniNetwork create(Context context); + } + /** The stage of the DefaultCniNetwork definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DefaultCniNetwork definition allowing to specify cniBgpConfiguration. */ + interface WithCniBgpConfiguration { + /** + * Specifies the cniBgpConfiguration property: CniBgpConfiguration represents the Calico BGP configuration. + * + *

The Calico BGP configuration.. + * + * @param cniBgpConfiguration CniBgpConfiguration represents the Calico BGP configuration. + *

The Calico BGP configuration. + * @return the next definition stage. + */ + WithCreate withCniBgpConfiguration(CniBgpConfiguration cniBgpConfiguration); + } + /** The stage of the DefaultCniNetwork definition allowing to specify ipAllocationType. */ + interface WithIpAllocationType { + /** + * Specifies the ipAllocationType property: The type of the IP address allocation.. + * + * @param ipAllocationType The type of the IP address allocation. + * @return the next definition stage. + */ + WithCreate withIpAllocationType(IpAllocationType ipAllocationType); + } + /** The stage of the DefaultCniNetwork definition allowing to specify ipv4ConnectedPrefix. */ + interface WithIpv4ConnectedPrefix { + /** + * Specifies the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this default CNI network. + * It is required when the IP allocation type is IPV4 or DualStack.. + * + * @param ipv4ConnectedPrefix The IPV4 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV4 or DualStack. + * @return the next definition stage. + */ + WithCreate withIpv4ConnectedPrefix(String ipv4ConnectedPrefix); + } + /** The stage of the DefaultCniNetwork definition allowing to specify ipv6ConnectedPrefix. */ + interface WithIpv6ConnectedPrefix { + /** + * Specifies the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this default CNI network. + * It is required when the IP allocation type is IPV6 or DualStack.. + * + * @param ipv6ConnectedPrefix The IPV6 prefix (CIDR) assigned to this default CNI network. It is required + * when the IP allocation type is IPV6 or DualStack. + * @return the next definition stage. + */ + WithCreate withIpv6ConnectedPrefix(String ipv6ConnectedPrefix); + } + } + /** + * Begins update for the DefaultCniNetwork resource. + * + * @return the stage of resource update. + */ + DefaultCniNetwork.Update update(); + + /** The template for DefaultCniNetwork update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DefaultCniNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DefaultCniNetwork apply(Context context); + } + /** The DefaultCniNetwork update stages. */ + interface UpdateStages { + /** The stage of the DefaultCniNetwork update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DefaultCniNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DefaultCniNetwork refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkDetailedStatus.java new file mode 100644 index 000000000000..fe746402ee1b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the default CNI network. */ +public final class DefaultCniNetworkDetailedStatus extends ExpandableStringEnum { + /** Static value Error for DefaultCniNetworkDetailedStatus. */ + public static final DefaultCniNetworkDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for DefaultCniNetworkDetailedStatus. */ + public static final DefaultCniNetworkDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for DefaultCniNetworkDetailedStatus. */ + public static final DefaultCniNetworkDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of DefaultCniNetworkDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultCniNetworkDetailedStatus() { + } + + /** + * Creates or finds a DefaultCniNetworkDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultCniNetworkDetailedStatus. + */ + @JsonCreator + public static DefaultCniNetworkDetailedStatus fromString(String name) { + return fromString(name, DefaultCniNetworkDetailedStatus.class); + } + + /** + * Gets known DefaultCniNetworkDetailedStatus values. + * + * @return known DefaultCniNetworkDetailedStatus values. + */ + public static Collection values() { + return values(DefaultCniNetworkDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkList.java new file mode 100644 index 000000000000..398a85bea457 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.DefaultCniNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** DefaultCniNetworkList represents a list of default CNI networks. */ +@Fluent +public final class DefaultCniNetworkList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of default CNI networks. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of DefaultCniNetworkList class. */ + public DefaultCniNetworkList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the DefaultCniNetworkList object itself. + */ + public DefaultCniNetworkList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of default CNI networks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of default CNI networks. + * + * @param value the value value to set. + * @return the DefaultCniNetworkList object itself. + */ + public DefaultCniNetworkList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkPatchParameters.java new file mode 100644 index 000000000000..e690d683e98a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkPatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** DefaultCniNetworkPatchParameters represents the body of the request to patch the Default CNI network. */ +@Fluent +public final class DefaultCniNetworkPatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of DefaultCniNetworkPatchParameters class. */ + public DefaultCniNetworkPatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the DefaultCniNetworkPatchParameters object itself. + */ + public DefaultCniNetworkPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkProvisioningState.java new file mode 100644 index 000000000000..6e6caf1fd631 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworkProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the default CNI network. */ +public final class DefaultCniNetworkProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for DefaultCniNetworkProvisioningState. */ + public static final DefaultCniNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DefaultCniNetworkProvisioningState. */ + public static final DefaultCniNetworkProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for DefaultCniNetworkProvisioningState. */ + public static final DefaultCniNetworkProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for DefaultCniNetworkProvisioningState. */ + public static final DefaultCniNetworkProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for DefaultCniNetworkProvisioningState. */ + public static final DefaultCniNetworkProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of DefaultCniNetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultCniNetworkProvisioningState() { + } + + /** + * Creates or finds a DefaultCniNetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultCniNetworkProvisioningState. + */ + @JsonCreator + public static DefaultCniNetworkProvisioningState fromString(String name) { + return fromString(name, DefaultCniNetworkProvisioningState.class); + } + + /** + * Gets known DefaultCniNetworkProvisioningState values. + * + * @return known DefaultCniNetworkProvisioningState values. + */ + public static Collection values() { + return values(DefaultCniNetworkProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworks.java new file mode 100644 index 000000000000..20c3d54b30b2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultCniNetworks.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DefaultCniNetworks. */ +public interface DefaultCniNetworks { + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 a list of default CNI networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List default CNI networks in the subscription. + * + *

Get a list of default CNI networks in the provided subscription. + * + * @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 a list of default CNI networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of default CNI networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List default CNI networks in the resource group. + * + *

Get a list of default CNI networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of default CNI networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String defaultCniNetworkName, Context context); + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 properties of the provided default CNI network. + */ + DefaultCniNetwork getByResourceGroup(String resourceGroupName, String defaultCniNetworkName); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 deleteByResourceGroup(String resourceGroupName, String defaultCniNetworkName); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param defaultCniNetworkName The name of the default CNI network. + * @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 delete(String resourceGroupName, String defaultCniNetworkName, Context context); + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param id the resource ID. + * @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 properties of the provided default CNI network along with {@link Response}. + */ + DefaultCniNetwork getById(String id); + + /** + * Retrieve the default CNI network. + * + *

Get properties of the provided default CNI network. + * + * @param id the resource ID. + * @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 properties of the provided default CNI network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the default CNI network. + * + *

Delete the provided default CNI network. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DefaultCniNetwork resource. + * + * @param name resource name. + * @return the first stage of the new DefaultCniNetwork definition. + */ + DefaultCniNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java new file mode 100644 index 000000000000..965f9dea4ef5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DefaultGateway.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The indicator of whether this is the default gateway. Only one of the attached networks (including the + * CloudServicesNetwork attachment) for a single machine may be specified as True. + */ +public final class DefaultGateway extends ExpandableStringEnum { + /** Static value True for DefaultGateway. */ + public static final DefaultGateway TRUE = fromString("True"); + + /** Static value False for DefaultGateway. */ + public static final DefaultGateway FALSE = fromString("False"); + + /** + * Creates a new instance of DefaultGateway value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultGateway() { + } + + /** + * Creates or finds a DefaultGateway from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultGateway. + */ + @JsonCreator + public static DefaultGateway fromString(String name) { + return fromString(name, DefaultGateway.class); + } + + /** + * Gets known DefaultGateway values. + * + * @return known DefaultGateway values. + */ + public static Collection values() { + return values(DefaultGateway.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java new file mode 100644 index 000000000000..db9d27f81548 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DeviceConnectionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The connection type of the device. */ +public final class DeviceConnectionType extends ExpandableStringEnum { + /** Static value PCI for DeviceConnectionType. */ + public static final DeviceConnectionType PCI = fromString("PCI"); + + /** + * Creates a new instance of DeviceConnectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeviceConnectionType() { + } + + /** + * Creates or finds a DeviceConnectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceConnectionType. + */ + @JsonCreator + public static DeviceConnectionType fromString(String name) { + return fromString(name, DeviceConnectionType.class); + } + + /** + * Gets known DeviceConnectionType values. + * + * @return known DeviceConnectionType values. + */ + public static Collection values() { + return values(DeviceConnectionType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.java new file mode 100644 index 000000000000..bc873fb4204e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/DiskType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The disk type of rack SKU resource. */ +public final class DiskType extends ExpandableStringEnum { + /** Static value HDD for DiskType. */ + public static final DiskType HDD = fromString("HDD"); + + /** Static value SSD for DiskType. */ + public static final DiskType SSD = fromString("SSD"); + + /** + * Creates a new instance of DiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskType() { + } + + /** + * Creates or finds a DiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskType. + */ + @JsonCreator + public static DiskType fromString(String name) { + return fromString(name, DiskType.class); + } + + /** + * Gets known DiskType values. + * + * @return known DiskType values. + */ + public static Collection values() { + return values(DiskType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java new file mode 100644 index 000000000000..8c1bb0b41c03 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EgressEndpoint.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * EgressEndpoint represents the connection from a cloud services network to the specified endpoint for a common + * purpose. + */ +@Fluent +public final class EgressEndpoint { + /* + * The descriptive category name of endpoints accessible by the AKS agent node. For example, + * azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the + * category 'default'. + */ + @JsonProperty(value = "category", required = true) + private String category; + + /* + * The list of endpoint dependencies. + */ + @JsonProperty(value = "endpoints", required = true) + private List endpoints; + + /** Creates an instance of EgressEndpoint class. */ + public EgressEndpoint() { + } + + /** + * Get the category property: The descriptive category name of endpoints accessible by the AKS agent node. For + * example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use + * the category 'default'. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The descriptive category name of endpoints accessible by the AKS agent node. For + * example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use + * the category 'default'. + * + * @param category the category value to set. + * @return the EgressEndpoint object itself. + */ + public EgressEndpoint withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the endpoints property: The list of endpoint dependencies. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The list of endpoint dependencies. + * + * @param endpoints the endpoints value to set. + * @return the EgressEndpoint object itself. + */ + public EgressEndpoint withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (category() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property category in model EgressEndpoint")); + } + if (endpoints() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property endpoints in model EgressEndpoint")); + } else { + endpoints().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EgressEndpoint.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java new file mode 100644 index 000000000000..c7513075f4f2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/EndpointDependency.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** EndpointDependency represents the definition of an endpoint, including the domain and details. */ +@Fluent +public final class EndpointDependency { + /* + * The domain name of the dependency. + */ + @JsonProperty(value = "domainName", required = true) + private String domainName; + + /* + * The port of this endpoint. + */ + @JsonProperty(value = "port") + private Long port; + + /** Creates an instance of EndpointDependency class. */ + public EndpointDependency() { + } + + /** + * Get the domainName property: The domain name of the dependency. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: The domain name of the dependency. + * + * @param domainName the domainName value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the port property: The port of this endpoint. + * + * @return the port value. + */ + public Long port() { + return this.port; + } + + /** + * Set the port property: The port of this endpoint. + * + * @param port the port value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withPort(Long port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property domainName in model EndpointDependency")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EndpointDependency.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java new file mode 100644 index 000000000000..8156b422dd08 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ExtendedLocation.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExtendedLocation represents the Azure custom location where the resource will be created. */ +@Fluent +public final class ExtendedLocation { + /* + * The resource ID of the extended location on which the resource will be created. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The extended location type, for example, CustomLocation. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + + /** + * Get the name property: The resource ID of the extended location on which the resource will be created. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource ID of the extended location on which the resource will be created. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The extended location type, for example, CustomLocation. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type, for example, CustomLocation. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ExtendedLocation")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ExtendedLocation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExtendedLocation.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java new file mode 100644 index 000000000000..67d790cdd15a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventory.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including + * information acquired from the model/sku information and from the ironic inspector. + */ +@Immutable +public final class HardwareInventory { + /* + * Freeform data extracted from the environment about this machine. This information varies depending on the + * specific hardware and configuration. + */ + @JsonProperty(value = "additionalHostInformation", access = JsonProperty.Access.WRITE_ONLY) + private String additionalHostInformation; + + /* + * The list of network interfaces and associated details for the bare metal machine. + */ + @JsonProperty(value = "interfaces", access = JsonProperty.Access.WRITE_ONLY) + private List interfaces; + + /* + * Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated + * details for the bare metal machine. + */ + @JsonProperty(value = "nics", access = JsonProperty.Access.WRITE_ONLY) + private List nics; + + /** Creates an instance of HardwareInventory class. */ + public HardwareInventory() { + } + + /** + * Get the additionalHostInformation property: Freeform data extracted from the environment about this machine. This + * information varies depending on the specific hardware and configuration. + * + * @return the additionalHostInformation value. + */ + public String additionalHostInformation() { + return this.additionalHostInformation; + } + + /** + * Get the interfaces property: The list of network interfaces and associated details for the bare metal machine. + * + * @return the interfaces value. + */ + public List interfaces() { + return this.interfaces; + } + + /** + * Get the nics property: Field Deprecated. Will be removed in an upcoming version. The list of network interface + * cards and associated details for the bare metal machine. + * + * @return the nics value. + */ + public List nics() { + return this.nics; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (interfaces() != null) { + interfaces().forEach(e -> e.validate()); + } + if (nics() != null) { + nics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java new file mode 100644 index 000000000000..9a8a222bb511 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareInventoryNetworkInterface.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. */ +@Immutable +public final class HardwareInventoryNetworkInterface { + /* + * The current status of the link. + */ + @JsonProperty(value = "linkStatus", access = JsonProperty.Access.WRITE_ONLY) + private String linkStatus; + + /* + * The MAC address associated with this interface. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * The name of the interface. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource ID of the network interface for the port on the switch that this machine's interface is connected + * to. + */ + @JsonProperty(value = "networkInterfaceId", access = JsonProperty.Access.WRITE_ONLY) + private String networkInterfaceId; + + /** Creates an instance of HardwareInventoryNetworkInterface class. */ + public HardwareInventoryNetworkInterface() { + } + + /** + * Get the linkStatus property: The current status of the link. + * + * @return the linkStatus value. + */ + public String linkStatus() { + return this.linkStatus; + } + + /** + * Get the macAddress property: The MAC address associated with this interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the name property: The name of the interface. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the networkInterfaceId property: The resource ID of the network interface for the port on the switch that + * this machine's interface is connected to. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.networkInterfaceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java new file mode 100644 index 000000000000..1a2670e7727c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HardwareValidationStatus.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. */ +@Immutable +public final class HardwareValidationStatus { + /* + * The timestamp of the hardware validation execution. + */ + @JsonProperty(value = "lastValidationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastValidationTime; + + /* + * The outcome of the hardware validation. + */ + @JsonProperty(value = "result", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineHardwareValidationResult result; + + /** Creates an instance of HardwareValidationStatus class. */ + public HardwareValidationStatus() { + } + + /** + * Get the lastValidationTime property: The timestamp of the hardware validation execution. + * + * @return the lastValidationTime value. + */ + public OffsetDateTime lastValidationTime() { + return this.lastValidationTime; + } + + /** + * Get the result property: The outcome of the hardware validation. + * + * @return the result value. + */ + public BareMetalMachineHardwareValidationResult result() { + return this.result; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksCluster.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksCluster.java new file mode 100644 index 000000000000..d90b4fac9f58 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksCluster.java @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.HybridAksClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of HybridAksCluster. */ +public interface HybridAksCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the associatedNetworkIds property: The list of resource IDs for the workload networks associated with the + * Hybrid AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks resources. This field will also + * contain one cloudServicesNetwork and one defaultCniNetwork. + * + * @return the associatedNetworkIds value. + */ + List associatedNetworkIds(); + + /** + * Gets the cloudServicesNetworkId property: The resource ID of the associated cloud services network. + * + * @return the cloudServicesNetworkId value. + */ + String cloudServicesNetworkId(); + + /** + * Gets the clusterId property: The resource ID of the Network Cloud cluster hosting the Hybrid AKS cluster. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the controlPlaneCount property: The number of control plane node VMs. + * + * @return the controlPlaneCount value. + */ + long controlPlaneCount(); + + /** + * Gets the controlPlaneNodes property: The list of node configurations detailing associated VMs that are part of + * the control plane nodes of this Hybrid AKS cluster. + * + * @return the controlPlaneNodes value. + */ + List controlPlaneNodes(); + + /** + * Gets the defaultCniNetworkId property: The resource ID of the associated default CNI network. + * + * @return the defaultCniNetworkId value. + */ + String defaultCniNetworkId(); + + /** + * Gets the detailedStatus property: The more detailed status of this Hybrid AKS cluster. + * + * @return the detailedStatus value. + */ + HybridAksClusterDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the hybridAksProvisionedClusterId property: The resource ID of the Hybrid AKS cluster that this additional + * information is for. + * + * @return the hybridAksProvisionedClusterId value. + */ + String hybridAksProvisionedClusterId(); + + /** + * Gets the provisioningState property: The provisioning state of the Hybrid AKS cluster resource. + * + * @return the provisioningState value. + */ + HybridAksClusterProvisioningState provisioningState(); + + /** + * Gets the volumes property: The resource IDs of volumes that are attached to the Hybrid AKS cluster. + * + * @return the volumes value. + */ + List volumes(); + + /** + * Gets the workerCount property: The number of worker node VMs. + * + * @return the workerCount value. + */ + long workerCount(); + + /** + * Gets the workerNodes property: The list of node configurations detailing associated VMs that are part of the + * worker nodes of this Hybrid AKS cluster. + * + * @return the workerNodes value. + */ + List workerNodes(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.HybridAksClusterInner object. + * + * @return the inner object. + */ + HybridAksClusterInner innerModel(); + + /** The entirety of the HybridAksCluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAssociatedNetworkIds, + DefinitionStages.WithControlPlaneCount, + DefinitionStages.WithHybridAksProvisionedClusterId, + DefinitionStages.WithWorkerCount, + DefinitionStages.WithCreate { + } + /** The HybridAksCluster definition stages. */ + interface DefinitionStages { + /** The first stage of the HybridAksCluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the HybridAksCluster definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the HybridAksCluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the HybridAksCluster definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithAssociatedNetworkIds withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the HybridAksCluster definition allowing to specify associatedNetworkIds. */ + interface WithAssociatedNetworkIds { + /** + * Specifies the associatedNetworkIds property: The list of resource IDs for the workload networks + * associated with the Hybrid AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks + * resources. This field will also contain one cloudServicesNetwork and one defaultCniNetwork.. + * + * @param associatedNetworkIds The list of resource IDs for the workload networks associated with the Hybrid + * AKS cluster. It can be any of l2Networks, l3Networks, or trunkedNetworks resources. This field will + * also contain one cloudServicesNetwork and one defaultCniNetwork. + * @return the next definition stage. + */ + WithControlPlaneCount withAssociatedNetworkIds(List associatedNetworkIds); + } + /** The stage of the HybridAksCluster definition allowing to specify controlPlaneCount. */ + interface WithControlPlaneCount { + /** + * Specifies the controlPlaneCount property: The number of control plane node VMs.. + * + * @param controlPlaneCount The number of control plane node VMs. + * @return the next definition stage. + */ + WithHybridAksProvisionedClusterId withControlPlaneCount(long controlPlaneCount); + } + /** The stage of the HybridAksCluster definition allowing to specify hybridAksProvisionedClusterId. */ + interface WithHybridAksProvisionedClusterId { + /** + * Specifies the hybridAksProvisionedClusterId property: The resource ID of the Hybrid AKS cluster that this + * additional information is for.. + * + * @param hybridAksProvisionedClusterId The resource ID of the Hybrid AKS cluster that this additional + * information is for. + * @return the next definition stage. + */ + WithWorkerCount withHybridAksProvisionedClusterId(String hybridAksProvisionedClusterId); + } + /** The stage of the HybridAksCluster definition allowing to specify workerCount. */ + interface WithWorkerCount { + /** + * Specifies the workerCount property: The number of worker node VMs.. + * + * @param workerCount The number of worker node VMs. + * @return the next definition stage. + */ + WithCreate withWorkerCount(long workerCount); + } + /** + * The stage of the HybridAksCluster 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.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + HybridAksCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HybridAksCluster create(Context context); + } + /** The stage of the HybridAksCluster definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the HybridAksCluster resource. + * + * @return the stage of resource update. + */ + HybridAksCluster.Update update(); + + /** The template for HybridAksCluster update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HybridAksCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HybridAksCluster apply(Context context); + } + /** The HybridAksCluster update stages. */ + interface UpdateStages { + /** The stage of the HybridAksCluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HybridAksCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HybridAksCluster refresh(Context context); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode(HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode(HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterDetailedStatus.java new file mode 100644 index 000000000000..b96f0b2711ad --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of this Hybrid AKS cluster. */ +public final class HybridAksClusterDetailedStatus extends ExpandableStringEnum { + /** Static value Error for HybridAksClusterDetailedStatus. */ + public static final HybridAksClusterDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for HybridAksClusterDetailedStatus. */ + public static final HybridAksClusterDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for HybridAksClusterDetailedStatus. */ + public static final HybridAksClusterDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of HybridAksClusterDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HybridAksClusterDetailedStatus() { + } + + /** + * Creates or finds a HybridAksClusterDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HybridAksClusterDetailedStatus. + */ + @JsonCreator + public static HybridAksClusterDetailedStatus fromString(String name) { + return fromString(name, HybridAksClusterDetailedStatus.class); + } + + /** + * Gets known HybridAksClusterDetailedStatus values. + * + * @return known HybridAksClusterDetailedStatus values. + */ + public static Collection values() { + return values(HybridAksClusterDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterList.java new file mode 100644 index 000000000000..a47beec5a174 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.HybridAksClusterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** HybridAksClusterList represents a list of Hybrid AKS clusters. */ +@Fluent +public final class HybridAksClusterList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of additional details related to Hybrid AKS clusters. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of HybridAksClusterList class. */ + public HybridAksClusterList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the HybridAksClusterList object itself. + */ + public HybridAksClusterList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of additional details related to Hybrid AKS clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of additional details related to Hybrid AKS clusters. + * + * @param value the value value to set. + * @return the HybridAksClusterList object itself. + */ + public HybridAksClusterList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterMachinePowerState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterMachinePowerState.java new file mode 100644 index 000000000000..5298754a4a4e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterMachinePowerState.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The power state (On | Off) of the node. */ +public final class HybridAksClusterMachinePowerState extends ExpandableStringEnum { + /** Static value On for HybridAksClusterMachinePowerState. */ + public static final HybridAksClusterMachinePowerState ON = fromString("On"); + + /** Static value Off for HybridAksClusterMachinePowerState. */ + public static final HybridAksClusterMachinePowerState OFF = fromString("Off"); + + /** + * Creates a new instance of HybridAksClusterMachinePowerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HybridAksClusterMachinePowerState() { + } + + /** + * Creates or finds a HybridAksClusterMachinePowerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HybridAksClusterMachinePowerState. + */ + @JsonCreator + public static HybridAksClusterMachinePowerState fromString(String name) { + return fromString(name, HybridAksClusterMachinePowerState.class); + } + + /** + * Gets known HybridAksClusterMachinePowerState values. + * + * @return known HybridAksClusterMachinePowerState values. + */ + public static Collection values() { + return values(HybridAksClusterMachinePowerState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterPatchParameters.java new file mode 100644 index 000000000000..d130e25b6e22 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterPatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** HybridAksClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. */ +@Fluent +public final class HybridAksClusterPatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of HybridAksClusterPatchParameters class. */ + public HybridAksClusterPatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the HybridAksClusterPatchParameters object itself. + */ + public HybridAksClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterProvisioningState.java new file mode 100644 index 000000000000..7fb92b2e86ca --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterProvisioningState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the Hybrid AKS cluster resource. */ +public final class HybridAksClusterProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for HybridAksClusterProvisioningState. */ + public static final HybridAksClusterProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for HybridAksClusterProvisioningState. */ + public static final HybridAksClusterProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for HybridAksClusterProvisioningState. */ + public static final HybridAksClusterProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of HybridAksClusterProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HybridAksClusterProvisioningState() { + } + + /** + * Creates or finds a HybridAksClusterProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HybridAksClusterProvisioningState. + */ + @JsonCreator + public static HybridAksClusterProvisioningState fromString(String name) { + return fromString(name, HybridAksClusterProvisioningState.class); + } + + /** + * Gets known HybridAksClusterProvisioningState values. + * + * @return known HybridAksClusterProvisioningState values. + */ + public static Collection values() { + return values(HybridAksClusterProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterRestartNodeParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterRestartNodeParameters.java new file mode 100644 index 000000000000..b1b8f849b18d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusterRestartNodeParameters.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HybridAksClusterRestartNodeParameters represents the body of the request to restart the node of a Hybrid AKS cluster. + */ +@Fluent +public final class HybridAksClusterRestartNodeParameters { + /* + * The name of the node to restart. + */ + @JsonProperty(value = "nodeName", required = true) + private String nodeName; + + /** Creates an instance of HybridAksClusterRestartNodeParameters class. */ + public HybridAksClusterRestartNodeParameters() { + } + + /** + * Get the nodeName property: The name of the node to restart. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the nodeName property: The name of the node to restart. + * + * @param nodeName the nodeName value to set. + * @return the HybridAksClusterRestartNodeParameters object itself. + */ + public HybridAksClusterRestartNodeParameters withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodeName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property nodeName in model HybridAksClusterRestartNodeParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HybridAksClusterRestartNodeParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusters.java new file mode 100644 index 000000000000..022de345b49f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksClusters.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of HybridAksClusters. */ +public interface HybridAksClusters { + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List additional details related to Hybrid AKS provisioned clusters in the subscription. + * + *

Get a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription. + * + * @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 a list of additional details related to Hybrid AKS provisioned clusters in the provided subscription as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List additional details related to Hybrid AKS provisioned clusters in the resource group. + * + *

Get a list of additional details for Hybrid AKS provisioned clusters in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of additional details for Hybrid AKS provisioned clusters in the provided resource group as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link + * Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String hybridAksClusterName, Context context); + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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 additional details related to the provided Hybrid AKS provisioned cluster. + */ + HybridAksCluster getByResourceGroup(String resourceGroupName, String hybridAksClusterName); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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. + */ + void deleteByResourceGroup(String resourceGroupName, String hybridAksClusterName); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS 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. + */ + void delete(String resourceGroupName, String hybridAksClusterName, Context context); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters); + + /** + * Restart a targeted node. + * + *

Restart a targeted node of a Hybrid AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param hybridAksClusterName The name of the Hybrid AKS cluster. + * @param hybridAksClusterRestartNodeParameters The request body. + * @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 restartNode( + String resourceGroupName, + String hybridAksClusterName, + HybridAksClusterRestartNodeParameters hybridAksClusterRestartNodeParameters, + Context context); + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param id the resource ID. + * @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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link + * Response}. + */ + HybridAksCluster getById(String id); + + /** + * Retrieve the additional details related to the Hybrid AKS provisioned cluster. + * + *

Get the additional details related to the provided Hybrid AKS provisioned cluster. + * + * @param id the resource ID. + * @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 additional details related to the provided Hybrid AKS provisioned cluster along with {@link + * Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the additional details related to the Hybrid AKS provisioned cluster. + * + *

Delete the additional details related to the provided Hybrid AKS provisioned cluster. All customer initiated + * requests will be rejected as the life cycle of this resource is managed by the system. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HybridAksCluster resource. + * + * @param name resource name. + * @return the first stage of the new HybridAksCluster definition. + */ + HybridAksCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java new file mode 100644 index 000000000000..4d6ce63aaf7f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksIpamEnabled.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the + * Hybrid AKS Cluster. + */ +public final class HybridAksIpamEnabled extends ExpandableStringEnum { + /** Static value True for HybridAksIpamEnabled. */ + public static final HybridAksIpamEnabled TRUE = fromString("True"); + + /** Static value False for HybridAksIpamEnabled. */ + public static final HybridAksIpamEnabled FALSE = fromString("False"); + + /** + * Creates a new instance of HybridAksIpamEnabled value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HybridAksIpamEnabled() { + } + + /** + * Creates or finds a HybridAksIpamEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding HybridAksIpamEnabled. + */ + @JsonCreator + public static HybridAksIpamEnabled fromString(String name) { + return fromString(name, HybridAksIpamEnabled.class); + } + + /** + * Gets known HybridAksIpamEnabled values. + * + * @return known HybridAksIpamEnabled values. + */ + public static Collection values() { + return values(HybridAksIpamEnabled.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java new file mode 100644 index 000000000000..7a824ee13443 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/HybridAksPluginType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The network plugin type for Hybrid AKS. */ +public final class HybridAksPluginType extends ExpandableStringEnum { + /** Static value DPDK for HybridAksPluginType. */ + public static final HybridAksPluginType DPDK = fromString("DPDK"); + + /** Static value SRIOV for HybridAksPluginType. */ + public static final HybridAksPluginType SRIOV = fromString("SRIOV"); + + /** Static value OSDevice for HybridAksPluginType. */ + public static final HybridAksPluginType OSDEVICE = fromString("OSDevice"); + + /** + * Creates a new instance of HybridAksPluginType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HybridAksPluginType() { + } + + /** + * Creates or finds a HybridAksPluginType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HybridAksPluginType. + */ + @JsonCreator + public static HybridAksPluginType fromString(String name) { + return fromString(name, HybridAksPluginType.class); + } + + /** + * Gets known HybridAksPluginType values. + * + * @return known HybridAksPluginType values. + */ + public static Collection values() { + return values(HybridAksPluginType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java new file mode 100644 index 000000000000..851d27be3f74 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ImageRepositoryCredentials.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ImageRepositoryCredentials represents the credentials used to login to the image repository. */ +@Fluent +public final class ImageRepositoryCredentials { + /* + * The password or token used to access an image in the target repository. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /* + * The URL of the authentication server used to validate the repository credentials. + */ + @JsonProperty(value = "registryUrl", required = true) + private String registryUrl; + + /* + * The username used to access an image in the target repository. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** Creates an instance of ImageRepositoryCredentials class. */ + public ImageRepositoryCredentials() { + } + + /** + * Get the password property: The password or token used to access an image in the target repository. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password or token used to access an image in the target repository. + * + * @param password the password value to set. + * @return the ImageRepositoryCredentials object itself. + */ + public ImageRepositoryCredentials withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the registryUrl property: The URL of the authentication server used to validate the repository credentials. + * + * @return the registryUrl value. + */ + public String registryUrl() { + return this.registryUrl; + } + + /** + * Set the registryUrl property: The URL of the authentication server used to validate the repository credentials. + * + * @param registryUrl the registryUrl value to set. + * @return the ImageRepositoryCredentials object itself. + */ + public ImageRepositoryCredentials withRegistryUrl(String registryUrl) { + this.registryUrl = registryUrl; + return this; + } + + /** + * Get the username property: The username used to access an image in the target repository. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username used to access an image in the target repository. + * + * @param username the username value to set. + * @return the ImageRepositoryCredentials object itself. + */ + public ImageRepositoryCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model ImageRepositoryCredentials")); + } + if (registryUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property registryUrl in model ImageRepositoryCredentials")); + } + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model ImageRepositoryCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImageRepositoryCredentials.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java new file mode 100644 index 000000000000..685fd31c266f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/IpAllocationType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the IP address allocation. */ +public final class IpAllocationType extends ExpandableStringEnum { + /** Static value IPV4 for IpAllocationType. */ + public static final IpAllocationType IPV4 = fromString("IPV4"); + + /** Static value IPV6 for IpAllocationType. */ + public static final IpAllocationType IPV6 = fromString("IPV6"); + + /** Static value DualStack for IpAllocationType. */ + public static final IpAllocationType DUAL_STACK = fromString("DualStack"); + + /** + * Creates a new instance of IpAllocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpAllocationType() { + } + + /** + * Creates or finds a IpAllocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationType. + */ + @JsonCreator + public static IpAllocationType fromString(String name) { + return fromString(name, IpAllocationType.class); + } + + /** + * Gets known IpAllocationType values. + * + * @return known IpAllocationType values. + */ + public static Collection values() { + return values(IpAllocationType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.java new file mode 100644 index 000000000000..a87057d6df14 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUser.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.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KeySetUser represents the properties of the user in the key set. */ +@Fluent +public final class KeySetUser { + /* + * The Azure Active Directory user name (email name). + */ + @JsonProperty(value = "azureUserName", required = true) + private String azureUsername; + + /* + * The free-form description for this user. + */ + @JsonProperty(value = "description") + private String description; + + /* + * SshPublicKey represents the public key used to authenticate with the virtual machine through SSH. + * + * The SSH public key for this user. + */ + @JsonProperty(value = "sshPublicKey", required = true) + private SshPublicKey sshPublicKey; + + /** Creates an instance of KeySetUser class. */ + public KeySetUser() { + } + + /** + * Get the azureUsername property: The Azure Active Directory user name (email name). + * + * @return the azureUsername value. + */ + public String azureUsername() { + return this.azureUsername; + } + + /** + * Set the azureUsername property: The Azure Active Directory user name (email name). + * + * @param azureUsername the azureUsername value to set. + * @return the KeySetUser object itself. + */ + public KeySetUser withAzureUsername(String azureUsername) { + this.azureUsername = azureUsername; + return this; + } + + /** + * Get the description property: The free-form description for this user. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The free-form description for this user. + * + * @param description the description value to set. + * @return the KeySetUser object itself. + */ + public KeySetUser withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key for this user. + * + * @return the sshPublicKey value. + */ + public SshPublicKey sshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: SshPublicKey represents the public key used to authenticate with the virtual + * machine through SSH. + * + *

The SSH public key for this user. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the KeySetUser object itself. + */ + public KeySetUser withSshPublicKey(SshPublicKey sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureUsername() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property azureUsername in model KeySetUser")); + } + if (sshPublicKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sshPublicKey in model KeySetUser")); + } else { + sshPublicKey().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeySetUser.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java new file mode 100644 index 000000000000..da41d052d530 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/KeySetUserStatus.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KeySetUserStatus represents the status of the key set user. */ +@Immutable +public final class KeySetUserStatus { + /* + * The Azure Active Directory user name (email name). + */ + @JsonProperty(value = "azureUserName", access = JsonProperty.Access.WRITE_ONLY) + private String azureUsername; + + /* + * The indicator of whether the user is currently deployed for access. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BareMetalMachineKeySetUserSetupStatus status; + + /* + * The additional information describing the current status of this user, if any available. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /** Creates an instance of KeySetUserStatus class. */ + public KeySetUserStatus() { + } + + /** + * Get the azureUsername property: The Azure Active Directory user name (email name). + * + * @return the azureUsername value. + */ + public String azureUsername() { + return this.azureUsername; + } + + /** + * Get the status property: The indicator of whether the user is currently deployed for access. + * + * @return the status value. + */ + public BareMetalMachineKeySetUserSetupStatus status() { + return this.status; + } + + /** + * Get the statusMessage property: The additional information describing the current status of this user, if any + * available. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java new file mode 100644 index 000000000000..76d5aefd8d33 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Network.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of L2Network. */ +public interface L2Network { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the clusterId property: The resource ID of the Network Cloud cluster this L2 network is associated with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the detailedStatus property: The more detailed status of the L2 network. + * + * @return the detailedStatus value. + */ + L2NetworkDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource ID(s) that are + * associated with this L2 network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + List hybridAksClustersAssociatedIds(); + + /** + * Gets the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + HybridAksPluginType hybridAksPluginType(); + + /** + * Gets the interfaceName property: The default interface name for this L2 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain. + * + * @return the l2IsolationDomainId value. + */ + String l2IsolationDomainId(); + + /** + * Gets the provisioningState property: The provisioning state of the L2 network. + * + * @return the provisioningState value. + */ + L2NetworkProvisioningState provisioningState(); + + /** + * Gets the virtualMachinesAssociatedIds property: The list of virtual machine resource ID(s), excluding any Hybrid + * AKS virtual machines, that are currently using this L2 network. + * + * @return the virtualMachinesAssociatedIds value. + */ + List virtualMachinesAssociatedIds(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner object. + * + * @return the inner object. + */ + L2NetworkInner innerModel(); + + /** The entirety of the L2Network definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithL2IsolationDomainId, + DefinitionStages.WithCreate { + } + /** The L2Network definition stages. */ + interface DefinitionStages { + /** The first stage of the L2Network definition. */ + interface Blank extends WithLocation { + } + /** The stage of the L2Network definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the L2Network definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the L2Network definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithL2IsolationDomainId withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the L2Network definition allowing to specify l2IsolationDomainId. */ + interface WithL2IsolationDomainId { + /** + * Specifies the l2IsolationDomainId property: The resource ID of the Network Fabric l2IsolationDomain.. + * + * @param l2IsolationDomainId The resource ID of the Network Fabric l2IsolationDomain. + * @return the next definition stage. + */ + WithCreate withL2IsolationDomainId(String l2IsolationDomainId); + } + /** + * The stage of the L2Network 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.WithTags, + DefinitionStages.WithHybridAksPluginType, + DefinitionStages.WithInterfaceName { + /** + * Executes the create request. + * + * @return the created resource. + */ + L2Network create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + L2Network create(Context context); + } + /** The stage of the L2Network definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the L2Network definition allowing to specify hybridAksPluginType. */ + interface WithHybridAksPluginType { + /** + * Specifies the hybridAksPluginType property: The network plugin type for Hybrid AKS.. + * + * @param hybridAksPluginType The network plugin type for Hybrid AKS. + * @return the next definition stage. + */ + WithCreate withHybridAksPluginType(HybridAksPluginType hybridAksPluginType); + } + /** The stage of the L2Network definition allowing to specify interfaceName. */ + interface WithInterfaceName { + /** + * Specifies the interfaceName property: The default interface name for this L2 network in the virtual + * machine. This name can be overridden by the name supplied in the network attachment configuration of that + * virtual machine.. + * + * @param interfaceName The default interface name for this L2 network in the virtual machine. This name can + * be overridden by the name supplied in the network attachment configuration of that virtual machine. + * @return the next definition stage. + */ + WithCreate withInterfaceName(String interfaceName); + } + } + /** + * Begins update for the L2Network resource. + * + * @return the stage of resource update. + */ + L2Network.Update update(); + + /** The template for L2Network update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + L2Network apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + L2Network apply(Context context); + } + /** The L2Network update stages. */ + interface UpdateStages { + /** The stage of the L2Network update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + L2Network refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + L2Network refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java new file mode 100644 index 000000000000..9880b8715d17 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the L2 network. */ +public final class L2NetworkDetailedStatus extends ExpandableStringEnum { + /** Static value Error for L2NetworkDetailedStatus. */ + public static final L2NetworkDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for L2NetworkDetailedStatus. */ + public static final L2NetworkDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for L2NetworkDetailedStatus. */ + public static final L2NetworkDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of L2NetworkDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public L2NetworkDetailedStatus() { + } + + /** + * Creates or finds a L2NetworkDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding L2NetworkDetailedStatus. + */ + @JsonCreator + public static L2NetworkDetailedStatus fromString(String name) { + return fromString(name, L2NetworkDetailedStatus.class); + } + + /** + * Gets known L2NetworkDetailedStatus values. + * + * @return known L2NetworkDetailedStatus values. + */ + public static Collection values() { + return values(L2NetworkDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java new file mode 100644 index 000000000000..f0e880f2c68e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.L2NetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** L2NetworkList represents a list of L2 networks. */ +@Fluent +public final class L2NetworkList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of L2 networks. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of L2NetworkList class. */ + public L2NetworkList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the L2NetworkList object itself. + */ + public L2NetworkList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of L2 networks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of L2 networks. + * + * @param value the value value to set. + * @return the L2NetworkList object itself. + */ + public L2NetworkList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java new file mode 100644 index 000000000000..72534a605d05 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkPatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** L2NetworkPatchParameters represents the body of the request to patch the L2 network. */ +@Fluent +public final class L2NetworkPatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of L2NetworkPatchParameters class. */ + public L2NetworkPatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the L2NetworkPatchParameters object itself. + */ + public L2NetworkPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java new file mode 100644 index 000000000000..c98da59a23c8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2NetworkProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the L2 network. */ +public final class L2NetworkProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for L2NetworkProvisioningState. */ + public static final L2NetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for L2NetworkProvisioningState. */ + public static final L2NetworkProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for L2NetworkProvisioningState. */ + public static final L2NetworkProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for L2NetworkProvisioningState. */ + public static final L2NetworkProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for L2NetworkProvisioningState. */ + public static final L2NetworkProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of L2NetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public L2NetworkProvisioningState() { + } + + /** + * Creates or finds a L2NetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding L2NetworkProvisioningState. + */ + @JsonCreator + public static L2NetworkProvisioningState fromString(String name) { + return fromString(name, L2NetworkProvisioningState.class); + } + + /** + * Gets known L2NetworkProvisioningState values. + * + * @return known L2NetworkProvisioningState values. + */ + public static Collection values() { + return values(L2NetworkProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java new file mode 100644 index 000000000000..6b288dbc3244 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L2Networks.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of L2Networks. */ +public interface L2Networks { + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List layer 2 (L2) networks in the subscription. + * + *

Get a list of layer 2 (L2) networks in the provided subscription. + * + * @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 a list of layer 2 (L2) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List layer 2 (L2) networks in the resource group. + * + *

Get a list of layer 2 (L2) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 2 (L2) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String l2NetworkName, Context context); + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 properties of the provided layer 2 (L2) network. + */ + L2Network getByResourceGroup(String resourceGroupName, String l2NetworkName); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 deleteByResourceGroup(String resourceGroupName, String l2NetworkName); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l2NetworkName The name of the L2 network. + * @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 delete(String resourceGroupName, String l2NetworkName, Context context); + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param id the resource ID. + * @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 properties of the provided layer 2 (L2) network along with {@link Response}. + */ + L2Network getById(String id); + + /** + * Retrieve the layer 2 (L2) network. + * + *

Get properties of the provided layer 2 (L2) network. + * + * @param id the resource ID. + * @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 properties of the provided layer 2 (L2) network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the layer 2 (L2) network. + * + *

Delete the provided layer 2 (L2) network. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new L2Network resource. + * + * @param name resource name. + * @return the first stage of the new L2Network definition. + */ + L2Network.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java new file mode 100644 index 000000000000..dd73c763ee64 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Network.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of L3Network. */ +public interface L3Network { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the clusterId property: The resource ID of the Network Cloud cluster this L3 network is associated with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the detailedStatus property: The more detailed status of the L3 network. + * + * @return the detailedStatus value. + */ + L3NetworkDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this L3 network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + List hybridAksClustersAssociatedIds(); + + /** + * Gets the hybridAksIpamEnabled property: The indicator of whether or not to disable IPAM allocation on the network + * attachment definition injected into the Hybrid AKS Cluster. + * + * @return the hybridAksIpamEnabled value. + */ + HybridAksIpamEnabled hybridAksIpamEnabled(); + + /** + * Gets the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + HybridAksPluginType hybridAksPluginType(); + + /** + * Gets the interfaceName property: The default interface name for this L3 network in the virtual machine. This name + * can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the ipAllocationType property: The type of the IP address allocation, defaulted to "DualStack". + * + * @return the ipAllocationType value. + */ + IpAllocationType ipAllocationType(); + + /** + * Gets the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV4 or DualStack. + * + * @return the ipv4ConnectedPrefix value. + */ + String ipv4ConnectedPrefix(); + + /** + * Gets the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV6 or DualStack. + * + * @return the ipv6ConnectedPrefix value. + */ + String ipv6ConnectedPrefix(); + + /** + * Gets the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain. + * + * @return the l3IsolationDomainId value. + */ + String l3IsolationDomainId(); + + /** + * Gets the provisioningState property: The provisioning state of the L3 network. + * + * @return the provisioningState value. + */ + L3NetworkProvisioningState provisioningState(); + + /** + * Gets the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid + * AKS virtual machines, that are currently using this L3 network. + * + * @return the virtualMachinesAssociatedIds value. + */ + List virtualMachinesAssociatedIds(); + + /** + * Gets the vlan property: The VLAN from the l3IsolationDomain that is used for this network. + * + * @return the vlan value. + */ + long vlan(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner object. + * + * @return the inner object. + */ + L3NetworkInner innerModel(); + + /** The entirety of the L3Network definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithL3IsolationDomainId, + DefinitionStages.WithVlan, + DefinitionStages.WithCreate { + } + /** The L3Network definition stages. */ + interface DefinitionStages { + /** The first stage of the L3Network definition. */ + interface Blank extends WithLocation { + } + /** The stage of the L3Network definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the L3Network definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the L3Network definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithL3IsolationDomainId withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the L3Network definition allowing to specify l3IsolationDomainId. */ + interface WithL3IsolationDomainId { + /** + * Specifies the l3IsolationDomainId property: The resource ID of the Network Fabric l3IsolationDomain.. + * + * @param l3IsolationDomainId The resource ID of the Network Fabric l3IsolationDomain. + * @return the next definition stage. + */ + WithVlan withL3IsolationDomainId(String l3IsolationDomainId); + } + /** The stage of the L3Network definition allowing to specify vlan. */ + interface WithVlan { + /** + * Specifies the vlan property: The VLAN from the l3IsolationDomain that is used for this network.. + * + * @param vlan The VLAN from the l3IsolationDomain that is used for this network. + * @return the next definition stage. + */ + WithCreate withVlan(long vlan); + } + /** + * The stage of the L3Network 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.WithTags, + DefinitionStages.WithHybridAksIpamEnabled, + DefinitionStages.WithHybridAksPluginType, + DefinitionStages.WithInterfaceName, + DefinitionStages.WithIpAllocationType, + DefinitionStages.WithIpv4ConnectedPrefix, + DefinitionStages.WithIpv6ConnectedPrefix { + /** + * Executes the create request. + * + * @return the created resource. + */ + L3Network create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + L3Network create(Context context); + } + /** The stage of the L3Network definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the L3Network definition allowing to specify hybridAksIpamEnabled. */ + interface WithHybridAksIpamEnabled { + /** + * Specifies the hybridAksIpamEnabled property: The indicator of whether or not to disable IPAM allocation + * on the network attachment definition injected into the Hybrid AKS Cluster.. + * + * @param hybridAksIpamEnabled The indicator of whether or not to disable IPAM allocation on the network + * attachment definition injected into the Hybrid AKS Cluster. + * @return the next definition stage. + */ + WithCreate withHybridAksIpamEnabled(HybridAksIpamEnabled hybridAksIpamEnabled); + } + /** The stage of the L3Network definition allowing to specify hybridAksPluginType. */ + interface WithHybridAksPluginType { + /** + * Specifies the hybridAksPluginType property: The network plugin type for Hybrid AKS.. + * + * @param hybridAksPluginType The network plugin type for Hybrid AKS. + * @return the next definition stage. + */ + WithCreate withHybridAksPluginType(HybridAksPluginType hybridAksPluginType); + } + /** The stage of the L3Network definition allowing to specify interfaceName. */ + interface WithInterfaceName { + /** + * Specifies the interfaceName property: The default interface name for this L3 network in the virtual + * machine. This name can be overridden by the name supplied in the network attachment configuration of that + * virtual machine.. + * + * @param interfaceName The default interface name for this L3 network in the virtual machine. This name can + * be overridden by the name supplied in the network attachment configuration of that virtual machine. + * @return the next definition stage. + */ + WithCreate withInterfaceName(String interfaceName); + } + /** The stage of the L3Network definition allowing to specify ipAllocationType. */ + interface WithIpAllocationType { + /** + * Specifies the ipAllocationType property: The type of the IP address allocation, defaulted to + * "DualStack".. + * + * @param ipAllocationType The type of the IP address allocation, defaulted to "DualStack". + * @return the next definition stage. + */ + WithCreate withIpAllocationType(IpAllocationType ipAllocationType); + } + /** The stage of the L3Network definition allowing to specify ipv4ConnectedPrefix. */ + interface WithIpv4ConnectedPrefix { + /** + * Specifies the ipv4ConnectedPrefix property: The IPV4 prefix (CIDR) assigned to this L3 network. Required + * when the IP allocation type is IPV4 or DualStack.. + * + * @param ipv4ConnectedPrefix The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV4 or DualStack. + * @return the next definition stage. + */ + WithCreate withIpv4ConnectedPrefix(String ipv4ConnectedPrefix); + } + /** The stage of the L3Network definition allowing to specify ipv6ConnectedPrefix. */ + interface WithIpv6ConnectedPrefix { + /** + * Specifies the ipv6ConnectedPrefix property: The IPV6 prefix (CIDR) assigned to this L3 network. Required + * when the IP allocation type is IPV6 or DualStack.. + * + * @param ipv6ConnectedPrefix The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP + * allocation type is IPV6 or DualStack. + * @return the next definition stage. + */ + WithCreate withIpv6ConnectedPrefix(String ipv6ConnectedPrefix); + } + } + /** + * Begins update for the L3Network resource. + * + * @return the stage of resource update. + */ + L3Network.Update update(); + + /** The template for L3Network update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + L3Network apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + L3Network apply(Context context); + } + /** The L3Network update stages. */ + interface UpdateStages { + /** The stage of the L3Network update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + L3Network refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + L3Network refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java new file mode 100644 index 000000000000..820cf9b025de --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the L3 network. */ +public final class L3NetworkDetailedStatus extends ExpandableStringEnum { + /** Static value Error for L3NetworkDetailedStatus. */ + public static final L3NetworkDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for L3NetworkDetailedStatus. */ + public static final L3NetworkDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for L3NetworkDetailedStatus. */ + public static final L3NetworkDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of L3NetworkDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public L3NetworkDetailedStatus() { + } + + /** + * Creates or finds a L3NetworkDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding L3NetworkDetailedStatus. + */ + @JsonCreator + public static L3NetworkDetailedStatus fromString(String name) { + return fromString(name, L3NetworkDetailedStatus.class); + } + + /** + * Gets known L3NetworkDetailedStatus values. + * + * @return known L3NetworkDetailedStatus values. + */ + public static Collection values() { + return values(L3NetworkDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java new file mode 100644 index 000000000000..58b433c99e2f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.L3NetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** L3NetworkList represents a list of L3 networks. */ +@Fluent +public final class L3NetworkList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of L3 networks. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of L3NetworkList class. */ + public L3NetworkList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the L3NetworkList object itself. + */ + public L3NetworkList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of L3 networks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of L3 networks. + * + * @param value the value value to set. + * @return the L3NetworkList object itself. + */ + public L3NetworkList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java new file mode 100644 index 000000000000..a64aec64d4f5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkPatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** L3NetworkPatchParameters represents the body of the request to patch the cloud services network. */ +@Fluent +public final class L3NetworkPatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of L3NetworkPatchParameters class. */ + public L3NetworkPatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the L3NetworkPatchParameters object itself. + */ + public L3NetworkPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java new file mode 100644 index 000000000000..3a5eab6857f7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3NetworkProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the L3 network. */ +public final class L3NetworkProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for L3NetworkProvisioningState. */ + public static final L3NetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for L3NetworkProvisioningState. */ + public static final L3NetworkProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for L3NetworkProvisioningState. */ + public static final L3NetworkProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for L3NetworkProvisioningState. */ + public static final L3NetworkProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for L3NetworkProvisioningState. */ + public static final L3NetworkProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of L3NetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public L3NetworkProvisioningState() { + } + + /** + * Creates or finds a L3NetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding L3NetworkProvisioningState. + */ + @JsonCreator + public static L3NetworkProvisioningState fromString(String name) { + return fromString(name, L3NetworkProvisioningState.class); + } + + /** + * Gets known L3NetworkProvisioningState values. + * + * @return known L3NetworkProvisioningState values. + */ + public static Collection values() { + return values(L3NetworkProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java new file mode 100644 index 000000000000..0b16ab745ad3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/L3Networks.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of L3Networks. */ +public interface L3Networks { + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List layer 3 (L3) networks in the subscription. + * + *

Get a list of layer 3 (L3) networks in the provided subscription. + * + * @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 a list of layer 3 (L3) networks in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List layer 3 (L3) networks in the resource group. + * + *

Get a list of layer 3 (L3) networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of layer 3 (L3) networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String l3NetworkName, Context context); + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 properties of the provided layer 3 (L3) network. + */ + L3Network getByResourceGroup(String resourceGroupName, String l3NetworkName); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 deleteByResourceGroup(String resourceGroupName, String l3NetworkName); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param l3NetworkName The name of the L3 network. + * @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 delete(String resourceGroupName, String l3NetworkName, Context context); + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param id the resource ID. + * @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 properties of the provided layer 3 (L3) network along with {@link Response}. + */ + L3Network getById(String id); + + /** + * Retrieve the layer 3 (L3) network. + * + *

Get properties of the provided layer 3 (L3) network. + * + * @param id the resource ID. + * @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 properties of the provided layer 3 (L3) network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the layer 3 (L3) network. + * + *

Delete the provided layer 3 (L3) network. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new L3Network resource. + * + * @param name resource name. + * @return the first stage of the new L3Network definition. + */ + L3Network.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java new file mode 100644 index 000000000000..c30a4a8ad01f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/LldpNeighbor.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents the details about the device + * connected to the NIC. + */ +@Immutable +public final class LldpNeighbor { + /* + * The descriptive information about the port on the connected device. + */ + @JsonProperty(value = "portDescription", access = JsonProperty.Access.WRITE_ONLY) + private String portDescription; + + /* + * The system-assigned name of the port on the connected device. + */ + @JsonProperty(value = "portName", access = JsonProperty.Access.WRITE_ONLY) + private String portName; + + /* + * The descriptive information about the connected device. + */ + @JsonProperty(value = "systemDescription", access = JsonProperty.Access.WRITE_ONLY) + private String systemDescription; + + /* + * The system-assigned name of the connected device. + */ + @JsonProperty(value = "systemName", access = JsonProperty.Access.WRITE_ONLY) + private String systemName; + + /** Creates an instance of LldpNeighbor class. */ + public LldpNeighbor() { + } + + /** + * Get the portDescription property: The descriptive information about the port on the connected device. + * + * @return the portDescription value. + */ + public String portDescription() { + return this.portDescription; + } + + /** + * Get the portName property: The system-assigned name of the port on the connected device. + * + * @return the portName value. + */ + public String portName() { + return this.portName; + } + + /** + * Get the systemDescription property: The descriptive information about the connected device. + * + * @return the systemDescription value. + */ + public String systemDescription() { + return this.systemDescription; + } + + /** + * Get the systemName property: The system-assigned name of the connected device. + * + * @return the systemName value. + */ + public String systemName() { + return this.systemName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java new file mode 100644 index 000000000000..57bb0b0de1eb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineDisk.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Disk represents the properties of the disk. */ +@Immutable +public final class MachineDisk { + /* + * The maximum amount of storage in GB. + */ + @JsonProperty(value = "capacityGB", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityGB; + + /* + * The connection type of the rack SKU resource. + */ + @JsonProperty(value = "connection", access = JsonProperty.Access.WRITE_ONLY) + private MachineSkuDiskConnectionType connection; + + /* + * The disk type of rack SKU resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private DiskType type; + + /** Creates an instance of MachineDisk class. */ + public MachineDisk() { + } + + /** + * Get the capacityGB property: The maximum amount of storage in GB. + * + * @return the capacityGB value. + */ + public Long capacityGB() { + return this.capacityGB; + } + + /** + * Get the connection property: The connection type of the rack SKU resource. + * + * @return the connection value. + */ + public MachineSkuDiskConnectionType connection() { + return this.connection; + } + + /** + * Get the type property: The disk type of rack SKU resource. + * + * @return the type value. + */ + public DiskType type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java new file mode 100644 index 000000000000..184b66ee0cca --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuDiskConnectionType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The connection type of the rack SKU resource. */ +public final class MachineSkuDiskConnectionType extends ExpandableStringEnum { + /** Static value PCIE for MachineSkuDiskConnectionType. */ + public static final MachineSkuDiskConnectionType PCIE = fromString("PCIE"); + + /** Static value SATA for MachineSkuDiskConnectionType. */ + public static final MachineSkuDiskConnectionType SATA = fromString("SATA"); + + /** Static value RAID for MachineSkuDiskConnectionType. */ + public static final MachineSkuDiskConnectionType RAID = fromString("RAID"); + + /** Static value SAS for MachineSkuDiskConnectionType. */ + public static final MachineSkuDiskConnectionType SAS = fromString("SAS"); + + /** + * Creates a new instance of MachineSkuDiskConnectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MachineSkuDiskConnectionType() { + } + + /** + * Creates or finds a MachineSkuDiskConnectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MachineSkuDiskConnectionType. + */ + @JsonCreator + public static MachineSkuDiskConnectionType fromString(String name) { + return fromString(name, MachineSkuDiskConnectionType.class); + } + + /** + * Gets known MachineSkuDiskConnectionType values. + * + * @return known MachineSkuDiskConnectionType values. + */ + public static Collection values() { + return values(MachineSkuDiskConnectionType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java new file mode 100644 index 000000000000..b6bba5a0558b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MachineSkuSlot.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.networkcloud.fluent.models.MachineSkuProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** MachineSkuSlot represents a single SKU and rack slot associated with the machine. */ +@Immutable +public final class MachineSkuSlot { + /* + * MachineSkuProperties represents the properties of the machine SKU. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private MachineSkuProperties innerProperties; + + /* + * The position in the rack for the machine. + */ + @JsonProperty(value = "rackSlot", access = JsonProperty.Access.WRITE_ONLY) + private Long rackSlot; + + /** Creates an instance of MachineSkuSlot class. */ + public MachineSkuSlot() { + } + + /** + * Get the innerProperties property: MachineSkuProperties represents the properties of the machine SKU. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private MachineSkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the rackSlot property: The position in the rack for the machine. + * + * @return the rackSlot value. + */ + public Long rackSlot() { + return this.rackSlot; + } + + /** + * Get the bootstrapProtocol property: The type of bootstrap protocol used. + * + * @return the bootstrapProtocol value. + */ + public BootstrapProtocol bootstrapProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().bootstrapProtocol(); + } + + /** + * Get the cpuCores property: The count of CPU cores for this machine. + * + * @return the cpuCores value. + */ + public Long cpuCores() { + return this.innerProperties() == null ? null : this.innerProperties().cpuCores(); + } + + /** + * Get the cpuSockets property: The count of CPU sockets for this machine. + * + * @return the cpuSockets value. + */ + public Long cpuSockets() { + return this.innerProperties() == null ? null : this.innerProperties().cpuSockets(); + } + + /** + * Get the disks property: The list of disks. + * + * @return the disks value. + */ + public List disks() { + return this.innerProperties() == null ? null : this.innerProperties().disks(); + } + + /** + * Get the generation property: The generation of the architecture. + * + * @return the generation value. + */ + public String generation() { + return this.innerProperties() == null ? null : this.innerProperties().generation(); + } + + /** + * Get the hardwareVersion property: The hardware version of the machine. + * + * @return the hardwareVersion value. + */ + public String hardwareVersion() { + return this.innerProperties() == null ? null : this.innerProperties().hardwareVersion(); + } + + /** + * Get the memoryCapacityGB property: The maximum amount of memory in GB. + * + * @return the memoryCapacityGB value. + */ + public Long memoryCapacityGB() { + return this.innerProperties() == null ? null : this.innerProperties().memoryCapacityGB(); + } + + /** + * Get the model property: The model of the machine. + * + * @return the model value. + */ + public String model() { + return this.innerProperties() == null ? null : this.innerProperties().model(); + } + + /** + * Get the networkInterfaces property: The list of network interfaces. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); + } + + /** + * Get the totalThreads property: The count of SMT and physical core threads for this machine. + * + * @return the totalThreads value. + */ + public Long totalThreads() { + return this.innerProperties() == null ? null : this.innerProperties().totalThreads(); + } + + /** + * Get the vendor property: The make of the machine. + * + * @return the vendor value. + */ + public String vendor() { + return this.innerProperties() == null ? null : this.innerProperties().vendor(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java new file mode 100644 index 000000000000..96992c087371 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ManagedResourceGroupConfiguration.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. */ +@Fluent +public final class ManagedResourceGroupConfiguration { + /* + * The location of the managed resource group. If not specified, the location of the parent resource is chosen. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The name for the managed resource group. If not specified, the unique name is automatically generated. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of ManagedResourceGroupConfiguration class. */ + public ManagedResourceGroupConfiguration() { + } + + /** + * Get the location property: The location of the managed resource group. If not specified, the location of the + * parent resource is chosen. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the managed resource group. If not specified, the location of the + * parent resource is chosen. + * + * @param location the location value to set. + * @return the ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the name property: The name for the managed resource group. If not specified, the unique name is + * automatically generated. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name for the managed resource group. If not specified, the unique name is + * automatically generated. + * + * @param name the name value to set. + * @return the ManagedResourceGroupConfiguration object itself. + */ + public ManagedResourceGroupConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java new file mode 100644 index 000000000000..00ebdd7cd803 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/MetricsConfigurations.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MetricsConfigurations. */ +public interface MetricsConfigurations { + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String clusterName); + + /** + * List metrics configurations of the cluster in the resource group. + * + *

Get a list of metrics configurations of the clusters in the provided resource group. + * + * @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 a list of metrics configurations of the clusters in the provided resource group as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String clusterName, Context context); + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String metricsConfigurationName, Context context); + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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 metrics configuration of the provided cluster. + */ + ClusterMetricsConfiguration get(String resourceGroupName, String clusterName, String metricsConfigurationName); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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. + */ + void delete(String resourceGroupName, String clusterName, String metricsConfigurationName); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the cluster. + * @param metricsConfigurationName The name of the metrics configuration for 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. + */ + void delete(String resourceGroupName, String clusterName, String metricsConfigurationName, Context context); + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param id the resource ID. + * @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 metrics configuration of the provided cluster along with {@link Response}. + */ + ClusterMetricsConfiguration getById(String id); + + /** + * Retrieve the metrics configuration of the cluster. + * + *

Get metrics configuration of the provided cluster. + * + * @param id the resource ID. + * @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 metrics configuration of the provided cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the metrics configuration of the cluster. + * + *

Delete the metrics configuration of the provided cluster. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ClusterMetricsConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new ClusterMetricsConfiguration definition. + */ + ClusterMetricsConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java new file mode 100644 index 000000000000..5173f1492bb3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkAttachment.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NetworkAttachment represents the single network attachment. */ +@Fluent +public final class NetworkAttachment { + /* + * The resource ID of the associated network attached to the virtual machine. + * It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + */ + @JsonProperty(value = "attachedNetworkId", required = true) + private String attachedNetworkId; + + /* + * The indicator of whether this is the default gateway. + * Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be + * specified as True. + */ + @JsonProperty(value = "defaultGateway") + private DefaultGateway defaultGateway; + + /* + * The IP allocation mechanism for the virtual machine. + * Dynamic and Static are only valid for l3Network which may also specify Disabled. + * Otherwise, Disabled is the only permitted value. + */ + @JsonProperty(value = "ipAllocationMethod", required = true) + private VirtualMachineIpAllocationMethod ipAllocationMethod; + + /* + * The IPv4 address of the virtual machine. + * + * This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + * + * If IPAllocationMethod is: + * Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached + * network. + * Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the + * attached network. + * Disabled - this field will be empty. + */ + @JsonProperty(value = "ipv4Address") + private String ipv4Address; + + /* + * The IPv6 address of the virtual machine. + * + * This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + * + * If IPAllocationMethod is: + * Static - this field must contain an IPv6 address range from within the range specified in the attached network. + * Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the + * attached network. + * Disabled - this field will be empty. + */ + @JsonProperty(value = "ipv6Address") + private String ipv6Address; + + /* + * The MAC address of the interface for the virtual machine that corresponds to this network attachment. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * The associated network's interface name. + * If specified, the network attachment name has a maximum length of 15 characters and must be unique to this + * virtual machine. + * If the user doesn’t specify this value, the default interface name of the network resource will be used. + * For a CloudServicesNetwork resource, this name will be ignored. + */ + @JsonProperty(value = "networkAttachmentName") + private String networkAttachmentName; + + /** Creates an instance of NetworkAttachment class. */ + public NetworkAttachment() { + } + + /** + * Get the attachedNetworkId property: The resource ID of the associated network attached to the virtual machine. It + * can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + * + * @return the attachedNetworkId value. + */ + public String attachedNetworkId() { + return this.attachedNetworkId; + } + + /** + * Set the attachedNetworkId property: The resource ID of the associated network attached to the virtual machine. It + * can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + * + * @param attachedNetworkId the attachedNetworkId value to set. + * @return the NetworkAttachment object itself. + */ + public NetworkAttachment withAttachedNetworkId(String attachedNetworkId) { + this.attachedNetworkId = attachedNetworkId; + return this; + } + + /** + * Get the defaultGateway property: The indicator of whether this is the default gateway. Only one of the attached + * networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. + * + * @return the defaultGateway value. + */ + public DefaultGateway defaultGateway() { + return this.defaultGateway; + } + + /** + * Set the defaultGateway property: The indicator of whether this is the default gateway. Only one of the attached + * networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. + * + * @param defaultGateway the defaultGateway value to set. + * @return the NetworkAttachment object itself. + */ + public NetworkAttachment withDefaultGateway(DefaultGateway defaultGateway) { + this.defaultGateway = defaultGateway; + return this; + } + + /** + * Get the ipAllocationMethod property: The IP allocation mechanism for the virtual machine. Dynamic and Static are + * only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. + * + * @return the ipAllocationMethod value. + */ + public VirtualMachineIpAllocationMethod ipAllocationMethod() { + return this.ipAllocationMethod; + } + + /** + * Set the ipAllocationMethod property: The IP allocation mechanism for the virtual machine. Dynamic and Static are + * only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. + * + * @param ipAllocationMethod the ipAllocationMethod value to set. + * @return the NetworkAttachment object itself. + */ + public NetworkAttachment withIpAllocationMethod(VirtualMachineIpAllocationMethod ipAllocationMethod) { + this.ipAllocationMethod = ipAllocationMethod; + return this; + } + + /** + * Get the ipv4Address property: The IPv4 address of the virtual machine. + * + *

This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + * + *

If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the + * subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an + * address from within the subnet specified in the attached network. Disabled - this field will be empty. + * + * @return the ipv4Address value. + */ + public String ipv4Address() { + return this.ipv4Address; + } + + /** + * Set the ipv4Address property: The IPv4 address of the virtual machine. + * + *

This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + * + *

If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the + * subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an + * address from within the subnet specified in the attached network. Disabled - this field will be empty. + * + * @param ipv4Address the ipv4Address value to set. + * @return the NetworkAttachment object itself. + */ + public NetworkAttachment withIpv4Address(String ipv4Address) { + this.ipv4Address = ipv4Address; + return this; + } + + /** + * Get the ipv6Address property: The IPv6 address of the virtual machine. + * + *

This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + * + *

If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range + * specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from + * within the subnet specified in the attached network. Disabled - this field will be empty. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set the ipv6Address property: The IPv6 address of the virtual machine. + * + *

This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + * + *

If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range + * specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from + * within the subnet specified in the attached network. Disabled - this field will be empty. + * + * @param ipv6Address the ipv6Address value to set. + * @return the NetworkAttachment object itself. + */ + public NetworkAttachment withIpv6Address(String ipv6Address) { + this.ipv6Address = ipv6Address; + return this; + } + + /** + * Get the macAddress property: The MAC address of the interface for the virtual machine that corresponds to this + * network attachment. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the networkAttachmentName property: The associated network's interface name. If specified, the network + * attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user + * doesn’t specify this value, the default interface name of the network resource will be used. For a + * CloudServicesNetwork resource, this name will be ignored. + * + * @return the networkAttachmentName value. + */ + public String networkAttachmentName() { + return this.networkAttachmentName; + } + + /** + * Set the networkAttachmentName property: The associated network's interface name. If specified, the network + * attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user + * doesn’t specify this value, the default interface name of the network resource will be used. For a + * CloudServicesNetwork resource, this name will be ignored. + * + * @param networkAttachmentName the networkAttachmentName value to set. + * @return the NetworkAttachment object itself. + */ + public NetworkAttachment withNetworkAttachmentName(String networkAttachmentName) { + this.networkAttachmentName = networkAttachmentName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attachedNetworkId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property attachedNetworkId in model NetworkAttachment")); + } + if (ipAllocationMethod() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ipAllocationMethod in model NetworkAttachment")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkAttachment.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.java new file mode 100644 index 000000000000..fd75e0077f2f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NetworkInterface.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.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NetworkInterface represents properties of the network interface. */ +@Immutable +public final class NetworkInterface { + /* + * The partial address of Peripheral Component Interconnect (PCI). + */ + @JsonProperty(value = "address", access = JsonProperty.Access.WRITE_ONLY) + private String address; + + /* + * The connection type of the device. + */ + @JsonProperty(value = "deviceConnectionType", access = JsonProperty.Access.WRITE_ONLY) + private DeviceConnectionType deviceConnectionType; + + /* + * The model name of the device. + */ + @JsonProperty(value = "model", access = JsonProperty.Access.WRITE_ONLY) + private String model; + + /* + * The physical slot for this device. + */ + @JsonProperty(value = "physicalSlot", access = JsonProperty.Access.WRITE_ONLY) + private Long physicalSlot; + + /* + * The number of ports on the device. + */ + @JsonProperty(value = "portCount", access = JsonProperty.Access.WRITE_ONLY) + private Long portCount; + + /* + * The maximum amount of data in GB that the line card transmits through a port at any given second. + */ + @JsonProperty(value = "portSpeed", access = JsonProperty.Access.WRITE_ONLY) + private Long portSpeed; + + /* + * The vendor name of the device. + */ + @JsonProperty(value = "vendor", access = JsonProperty.Access.WRITE_ONLY) + private String vendor; + + /** Creates an instance of NetworkInterface class. */ + public NetworkInterface() { + } + + /** + * Get the address property: The partial address of Peripheral Component Interconnect (PCI). + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Get the deviceConnectionType property: The connection type of the device. + * + * @return the deviceConnectionType value. + */ + public DeviceConnectionType deviceConnectionType() { + return this.deviceConnectionType; + } + + /** + * Get the model property: The model name of the device. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Get the physicalSlot property: The physical slot for this device. + * + * @return the physicalSlot value. + */ + public Long physicalSlot() { + return this.physicalSlot; + } + + /** + * Get the portCount property: The number of ports on the device. + * + * @return the portCount value. + */ + public Long portCount() { + return this.portCount; + } + + /** + * Get the portSpeed property: The maximum amount of data in GB that the line card transmits through a port at any + * given second. + * + * @return the portSpeed value. + */ + public Long portSpeed() { + return this.portSpeed; + } + + /** + * Get the vendor property: The vendor name of the device. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java new file mode 100644 index 000000000000..e1ffb72901fe --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Nic.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. */ +@Immutable +public final class Nic { + /* + * Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents the details about the device + * connected to the NIC. + * + * The information about the device connected to this NIC. + */ + @JsonProperty(value = "lldpNeighbor", access = JsonProperty.Access.WRITE_ONLY) + private LldpNeighbor lldpNeighbor; + + /* + * The MAC address associated with this NIC. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * The name of the NIC/interface. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** Creates an instance of Nic class. */ + public Nic() { + } + + /** + * Get the lldpNeighbor property: Type Deprecated. Will be removed in an upcoming version. LldpNeighbor represents + * the details about the device connected to the NIC. + * + *

The information about the device connected to this NIC. + * + * @return the lldpNeighbor value. + */ + public LldpNeighbor lldpNeighbor() { + return this.lldpNeighbor; + } + + /** + * Get the macAddress property: The MAC address associated with this NIC. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the name property: The name of the NIC/interface. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lldpNeighbor() != null) { + lldpNeighbor().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Node.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Node.java new file mode 100644 index 000000000000..998b90d5507b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Node.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Node denotes the list of node that utilizes configuration. */ +@Immutable +public final class Node { + /* + * The resource ID of the bare metal machine that hosts this node. + */ + @JsonProperty(value = "bareMetalMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String bareMetalMachineId; + + /* + * The machine image last used to deploy this node. + */ + @JsonProperty(value = "imageId", access = JsonProperty.Access.WRITE_ONLY) + private String imageId; + + /* + * The list of network attachments to the virtual machine. + */ + @JsonProperty(value = "networkAttachments", access = JsonProperty.Access.WRITE_ONLY) + private List networkAttachments; + + /* + * The name of this node, as realized in the Hybrid AKS cluster. + */ + @JsonProperty(value = "nodeName", access = JsonProperty.Access.WRITE_ONLY) + private String nodeName; + + /* + * The power state (On | Off) of the node. + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private HybridAksClusterMachinePowerState powerState; + + /** Creates an instance of Node class. */ + public Node() { + } + + /** + * Get the bareMetalMachineId property: The resource ID of the bare metal machine that hosts this node. + * + * @return the bareMetalMachineId value. + */ + public String bareMetalMachineId() { + return this.bareMetalMachineId; + } + + /** + * Get the imageId property: The machine image last used to deploy this node. + * + * @return the imageId value. + */ + public String imageId() { + return this.imageId; + } + + /** + * Get the networkAttachments property: The list of network attachments to the virtual machine. + * + * @return the networkAttachments value. + */ + public List networkAttachments() { + return this.networkAttachments; + } + + /** + * Get the nodeName property: The name of this node, as realized in the Hybrid AKS cluster. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Get the powerState property: The power state (On | Off) of the node. + * + * @return the powerState value. + */ + public HybridAksClusterMachinePowerState powerState() { + return this.powerState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkAttachments() != null) { + networkAttachments().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodeConfiguration.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodeConfiguration.java new file mode 100644 index 000000000000..5c6bfd7f8d31 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/NodeConfiguration.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NodeConfiguration contains configuration for a VM associated with a node. */ +@Immutable +public final class NodeConfiguration { + /* + * The resource ID of the agent pool that contains the nodes in this configuration. + */ + @JsonProperty(value = "agentPoolId", access = JsonProperty.Access.WRITE_ONLY) + private String agentPoolId; + + /* + * The name of the agent pool that contains the nodes in this configuration. + */ + @JsonProperty(value = "agentPoolName", access = JsonProperty.Access.WRITE_ONLY) + private String agentPoolName; + + /* + * The number of CPU cores in the virtual machine. + */ + @JsonProperty(value = "cpuCores", access = JsonProperty.Access.WRITE_ONLY) + private Long cpuCores; + + /* + * The root disk size of the virtual machine in GB. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Long diskSizeGB; + + /* + * The memory size of the virtual machine in GB. + */ + @JsonProperty(value = "memorySizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Long memorySizeGB; + + /* + * Field deprecated, use agentPoolName instead. This field will be removed in a future version but will reflect the + * name of the agent pool that contains the nodes in this configuration. + */ + @JsonProperty(value = "nodePoolName", access = JsonProperty.Access.WRITE_ONLY) + private String nodePoolName; + + /* + * The list of nodes that utilize this configuration. + */ + @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY) + private List nodes; + + /* + * The number of virtual machines that use this configuration. + */ + @JsonProperty(value = "vmCount", access = JsonProperty.Access.WRITE_ONLY) + private Long vmCount; + + /* + * The name of the VM size supplied during the creation of the cluster. + */ + @JsonProperty(value = "vmSize", access = JsonProperty.Access.WRITE_ONLY) + private String vmSize; + + /** Creates an instance of NodeConfiguration class. */ + public NodeConfiguration() { + } + + /** + * Get the agentPoolId property: The resource ID of the agent pool that contains the nodes in this configuration. + * + * @return the agentPoolId value. + */ + public String agentPoolId() { + return this.agentPoolId; + } + + /** + * Get the agentPoolName property: The name of the agent pool that contains the nodes in this configuration. + * + * @return the agentPoolName value. + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Get the cpuCores property: The number of CPU cores in the virtual machine. + * + * @return the cpuCores value. + */ + public Long cpuCores() { + return this.cpuCores; + } + + /** + * Get the diskSizeGB property: The root disk size of the virtual machine in GB. + * + * @return the diskSizeGB value. + */ + public Long diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Get the memorySizeGB property: The memory size of the virtual machine in GB. + * + * @return the memorySizeGB value. + */ + public Long memorySizeGB() { + return this.memorySizeGB; + } + + /** + * Get the nodePoolName property: Field deprecated, use agentPoolName instead. This field will be removed in a + * future version but will reflect the name of the agent pool that contains the nodes in this configuration. + * + * @return the nodePoolName value. + */ + public String nodePoolName() { + return this.nodePoolName; + } + + /** + * Get the nodes property: The list of nodes that utilize this configuration. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Get the vmCount property: The number of virtual machines that use this configuration. + * + * @return the vmCount value. + */ + public Long vmCount() { + return this.vmCount; + } + + /** + * Get the vmSize property: The name of the VM size supplied during the creation of the cluster. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java new file mode 100644 index 000000000000..a8094260521c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.java new file mode 100644 index 000000000000..570f1e40a76d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationDisplay.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.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java new file mode 100644 index 000000000000..ec41868b62e5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.networkcloud.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java new file mode 100644 index 000000000000..236d3e6af315 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Operations.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 a list of all available resource provider operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List resource provider operations. + * + *

Get a list of all available resource provider operations. It contains a URL link to get the next set of + * results. + * + * @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 a list of all available resource provider operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java new file mode 100644 index 000000000000..454b563ddda3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Origin.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java new file mode 100644 index 000000000000..a7131360ea55 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDisk.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OsDisk represents configuration of the boot disk. */ +@Fluent +public final class OsDisk { + /* + * The strategy for creating the OS disk. + */ + @JsonProperty(value = "createOption") + private OsDiskCreateOption createOption; + + /* + * The strategy for deleting the OS disk. + */ + @JsonProperty(value = "deleteOption") + private OsDiskDeleteOption deleteOption; + + /* + * The size of the disk in gigabytes. Required if the createOption is Ephemeral. + */ + @JsonProperty(value = "diskSizeGB", required = true) + private long diskSizeGB; + + /** Creates an instance of OsDisk class. */ + public OsDisk() { + } + + /** + * Get the createOption property: The strategy for creating the OS disk. + * + * @return the createOption value. + */ + public OsDiskCreateOption createOption() { + return this.createOption; + } + + /** + * Set the createOption property: The strategy for creating the OS disk. + * + * @param createOption the createOption value to set. + * @return the OsDisk object itself. + */ + public OsDisk withCreateOption(OsDiskCreateOption createOption) { + this.createOption = createOption; + return this; + } + + /** + * Get the deleteOption property: The strategy for deleting the OS disk. + * + * @return the deleteOption value. + */ + public OsDiskDeleteOption deleteOption() { + return this.deleteOption; + } + + /** + * Set the deleteOption property: The strategy for deleting the OS disk. + * + * @param deleteOption the deleteOption value to set. + * @return the OsDisk object itself. + */ + public OsDisk withDeleteOption(OsDiskDeleteOption deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Get the diskSizeGB property: The size of the disk in gigabytes. Required if the createOption is Ephemeral. + * + * @return the diskSizeGB value. + */ + public long diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB property: The size of the disk in gigabytes. Required if the createOption is Ephemeral. + * + * @param diskSizeGB the diskSizeGB value to set. + * @return the OsDisk object itself. + */ + public OsDisk withDiskSizeGB(long diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java new file mode 100644 index 000000000000..9791c86b5c1c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskCreateOption.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The strategy for creating the OS disk. */ +public final class OsDiskCreateOption extends ExpandableStringEnum { + /** Static value Ephemeral for OsDiskCreateOption. */ + public static final OsDiskCreateOption EPHEMERAL = fromString("Ephemeral"); + + /** + * Creates a new instance of OsDiskCreateOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OsDiskCreateOption() { + } + + /** + * Creates or finds a OsDiskCreateOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding OsDiskCreateOption. + */ + @JsonCreator + public static OsDiskCreateOption fromString(String name) { + return fromString(name, OsDiskCreateOption.class); + } + + /** + * Gets known OsDiskCreateOption values. + * + * @return known OsDiskCreateOption values. + */ + public static Collection values() { + return values(OsDiskCreateOption.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java new file mode 100644 index 000000000000..d6930fcd0023 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/OsDiskDeleteOption.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The strategy for deleting the OS disk. */ +public final class OsDiskDeleteOption extends ExpandableStringEnum { + /** Static value Delete for OsDiskDeleteOption. */ + public static final OsDiskDeleteOption DELETE = fromString("Delete"); + + /** + * Creates a new instance of OsDiskDeleteOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OsDiskDeleteOption() { + } + + /** + * Creates or finds a OsDiskDeleteOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding OsDiskDeleteOption. + */ + @JsonCreator + public static OsDiskDeleteOption fromString(String name) { + return fromString(name, OsDiskDeleteOption.class); + } + + /** + * Gets known OsDiskDeleteOption values. + * + * @return known OsDiskDeleteOption values. + */ + public static Collection values() { + return values(OsDiskDeleteOption.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java new file mode 100644 index 000000000000..196dcb9b0172 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Rack.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; +import java.util.Map; + +/** An immutable client-side representation of Rack. */ +public interface Rack { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the availabilityZone property: The value that will be used for machines in this rack to represent the + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * + * @return the availabilityZone value. + */ + String availabilityZone(); + + /** + * Gets the clusterId property: The resource ID of the cluster the rack is created for. This value is set when the + * rack is created by the cluster. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the detailedStatus property: The more detailed status of the rack. + * + * @return the detailedStatus value. + */ + RackDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the provisioningState property: The provisioning state of the rack resource. + * + * @return the provisioningState value. + */ + RackProvisioningState provisioningState(); + + /** + * Gets the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @return the rackLocation value. + */ + String rackLocation(); + + /** + * Gets the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @return the rackSerialNumber value. + */ + String rackSerialNumber(); + + /** + * Gets the rackSkuId property: The SKU for the rack. + * + * @return the rackSkuId value. + */ + String rackSkuId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.RackInner object. + * + * @return the inner object. + */ + RackInner innerModel(); + + /** The entirety of the Rack definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAvailabilityZone, + DefinitionStages.WithRackLocation, + DefinitionStages.WithRackSerialNumber, + DefinitionStages.WithRackSkuId, + DefinitionStages.WithCreate { + } + /** The Rack definition stages. */ + interface DefinitionStages { + /** The first stage of the Rack definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Rack definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Rack definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Rack definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithAvailabilityZone withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Rack definition allowing to specify availabilityZone. */ + interface WithAvailabilityZone { + /** + * Specifies the availabilityZone property: The value that will be used for machines in this rack to + * represent the availability zones that can be referenced by Hybrid AKS Clusters for node arrangement.. + * + * @param availabilityZone The value that will be used for machines in this rack to represent the + * availability zones that can be referenced by Hybrid AKS Clusters for node arrangement. + * @return the next definition stage. + */ + WithRackLocation withAvailabilityZone(String availabilityZone); + } + /** The stage of the Rack definition allowing to specify rackLocation. */ + interface WithRackLocation { + /** + * Specifies the rackLocation property: The free-form description of the rack location. (e.g. “DTN + * Datacenter, Floor 3, Isle 9, Rack 2B”). + * + * @param rackLocation The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle + * 9, Rack 2B”). + * @return the next definition stage. + */ + WithRackSerialNumber withRackLocation(String rackLocation); + } + /** The stage of the Rack definition allowing to specify rackSerialNumber. */ + interface WithRackSerialNumber { + /** + * Specifies the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. + * An alternate unique alphanumeric value other than a serial number may be provided if desired.. + * + * @param rackSerialNumber The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * @return the next definition stage. + */ + WithRackSkuId withRackSerialNumber(String rackSerialNumber); + } + /** The stage of the Rack definition allowing to specify rackSkuId. */ + interface WithRackSkuId { + /** + * Specifies the rackSkuId property: The SKU for the rack.. + * + * @param rackSkuId The SKU for the rack. + * @return the next definition stage. + */ + WithCreate withRackSkuId(String rackSkuId); + } + /** + * The stage of the Rack 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.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + Rack create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Rack create(Context context); + } + /** The stage of the Rack definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the Rack resource. + * + * @return the stage of resource update. + */ + Rack.Update update(); + + /** The template for Rack update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithRackLocation, UpdateStages.WithRackSerialNumber { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Rack apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Rack apply(Context context); + } + /** The Rack update stages. */ + interface UpdateStages { + /** The stage of the Rack update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Rack update allowing to specify rackLocation. */ + interface WithRackLocation { + /** + * Specifies the rackLocation property: The free-form description of the rack location. (e.g. “DTN + * Datacenter, Floor 3, Isle 9, Rack 2B”). + * + * @param rackLocation The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle + * 9, Rack 2B”). + * @return the next definition stage. + */ + Update withRackLocation(String rackLocation); + } + /** The stage of the Rack update allowing to specify rackSerialNumber. */ + interface WithRackSerialNumber { + /** + * Specifies the rackSerialNumber property: The globally unique identifier for the rack.. + * + * @param rackSerialNumber The globally unique identifier for the rack. + * @return the next definition stage. + */ + Update withRackSerialNumber(String rackSerialNumber); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Rack refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Rack refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java new file mode 100644 index 000000000000..bb2c2bbd7b49 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDefinition.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RackDefinition represents details regarding the rack. */ +@Fluent +public final class RackDefinition { + /* + * The zone name used for this rack when created. + */ + @JsonProperty(value = "availabilityZone") + private String availabilityZone; + + /* + * The unordered list of bare metal machine configuration. + */ + @JsonProperty(value = "bareMetalMachineConfigurationData") + private List bareMetalMachineConfigurationData; + + /* + * The resource ID of the network rack that matches this rack definition. + */ + @JsonProperty(value = "networkRackId", required = true) + private String networkRackId; + + /* + * The free-form description of the rack's location. + */ + @JsonProperty(value = "rackLocation") + private String rackLocation; + + /* + * The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other + * than a serial number may be provided if desired. + */ + @JsonProperty(value = "rackSerialNumber", required = true) + private String rackSerialNumber; + + /* + * The resource ID of the sku for the rack being added. + */ + @JsonProperty(value = "rackSkuId", required = true) + private String rackSkuId; + + /* + * The list of storage appliance configuration data for this rack. + */ + @JsonProperty(value = "storageApplianceConfigurationData") + private List storageApplianceConfigurationData; + + /** Creates an instance of RackDefinition class. */ + public RackDefinition() { + } + + /** + * Get the availabilityZone property: The zone name used for this rack when created. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The zone name used for this rack when created. + * + * @param availabilityZone the availabilityZone value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the bareMetalMachineConfigurationData property: The unordered list of bare metal machine configuration. + * + * @return the bareMetalMachineConfigurationData value. + */ + public List bareMetalMachineConfigurationData() { + return this.bareMetalMachineConfigurationData; + } + + /** + * Set the bareMetalMachineConfigurationData property: The unordered list of bare metal machine configuration. + * + * @param bareMetalMachineConfigurationData the bareMetalMachineConfigurationData value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withBareMetalMachineConfigurationData( + List bareMetalMachineConfigurationData) { + this.bareMetalMachineConfigurationData = bareMetalMachineConfigurationData; + return this; + } + + /** + * Get the networkRackId property: The resource ID of the network rack that matches this rack definition. + * + * @return the networkRackId value. + */ + public String networkRackId() { + return this.networkRackId; + } + + /** + * Set the networkRackId property: The resource ID of the network rack that matches this rack definition. + * + * @param networkRackId the networkRackId value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withNetworkRackId(String networkRackId) { + this.networkRackId = networkRackId; + return this; + } + + /** + * Get the rackLocation property: The free-form description of the rack's location. + * + * @return the rackLocation value. + */ + public String rackLocation() { + return this.rackLocation; + } + + /** + * Set the rackLocation property: The free-form description of the rack's location. + * + * @param rackLocation the rackLocation value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withRackLocation(String rackLocation) { + this.rackLocation = rackLocation; + return this; + } + + /** + * Get the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @return the rackSerialNumber value. + */ + public String rackSerialNumber() { + return this.rackSerialNumber; + } + + /** + * Set the rackSerialNumber property: The unique identifier for the rack within Network Cloud cluster. An alternate + * unique alphanumeric value other than a serial number may be provided if desired. + * + * @param rackSerialNumber the rackSerialNumber value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withRackSerialNumber(String rackSerialNumber) { + this.rackSerialNumber = rackSerialNumber; + return this; + } + + /** + * Get the rackSkuId property: The resource ID of the sku for the rack being added. + * + * @return the rackSkuId value. + */ + public String rackSkuId() { + return this.rackSkuId; + } + + /** + * Set the rackSkuId property: The resource ID of the sku for the rack being added. + * + * @param rackSkuId the rackSkuId value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withRackSkuId(String rackSkuId) { + this.rackSkuId = rackSkuId; + return this; + } + + /** + * Get the storageApplianceConfigurationData property: The list of storage appliance configuration data for this + * rack. + * + * @return the storageApplianceConfigurationData value. + */ + public List storageApplianceConfigurationData() { + return this.storageApplianceConfigurationData; + } + + /** + * Set the storageApplianceConfigurationData property: The list of storage appliance configuration data for this + * rack. + * + * @param storageApplianceConfigurationData the storageApplianceConfigurationData value to set. + * @return the RackDefinition object itself. + */ + public RackDefinition withStorageApplianceConfigurationData( + List storageApplianceConfigurationData) { + this.storageApplianceConfigurationData = storageApplianceConfigurationData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bareMetalMachineConfigurationData() != null) { + bareMetalMachineConfigurationData().forEach(e -> e.validate()); + } + if (networkRackId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property networkRackId in model RackDefinition")); + } + if (rackSerialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rackSerialNumber in model RackDefinition")); + } + if (rackSkuId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property rackSkuId in model RackDefinition")); + } + if (storageApplianceConfigurationData() != null) { + storageApplianceConfigurationData().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RackDefinition.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java new file mode 100644 index 000000000000..17299e967c05 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the rack. */ +public final class RackDetailedStatus extends ExpandableStringEnum { + /** Static value Error for RackDetailedStatus. */ + public static final RackDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for RackDetailedStatus. */ + public static final RackDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for RackDetailedStatus. */ + public static final RackDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of RackDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RackDetailedStatus() { + } + + /** + * Creates or finds a RackDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RackDetailedStatus. + */ + @JsonCreator + public static RackDetailedStatus fromString(String name) { + return fromString(name, RackDetailedStatus.class); + } + + /** + * Gets known RackDetailedStatus values. + * + * @return known RackDetailedStatus values. + */ + public static Collection values() { + return values(RackDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java new file mode 100644 index 000000000000..689372ecad3f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.RackInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RackList represents a list of racks. */ +@Fluent +public final class RackList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of racks. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of RackList class. */ + public RackList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the RackList object itself. + */ + public RackList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of racks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of racks. + * + * @param value the value value to set. + * @return the RackList object itself. + */ + public RackList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.java new file mode 100644 index 000000000000..9084fdf22256 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackPatchParameters.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.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.RacksPatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** RackPatchParameters represents the body of the request to patch the rack properties. */ +@Fluent +public final class RackPatchParameters { + /* + * RacksPatchProperties represents the properties of the rack during patching. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private RacksPatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of RackPatchParameters class. */ + public RackPatchParameters() { + } + + /** + * Get the innerProperties property: RacksPatchProperties represents the properties of the rack during patching. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private RacksPatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the RackPatchParameters object itself. + */ + public RackPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @return the rackLocation value. + */ + public String rackLocation() { + return this.innerProperties() == null ? null : this.innerProperties().rackLocation(); + } + + /** + * Set the rackLocation property: The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, + * Isle 9, Rack 2B”). + * + * @param rackLocation the rackLocation value to set. + * @return the RackPatchParameters object itself. + */ + public RackPatchParameters withRackLocation(String rackLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new RacksPatchProperties(); + } + this.innerProperties().withRackLocation(rackLocation); + return this; + } + + /** + * Get the rackSerialNumber property: The globally unique identifier for the rack. + * + * @return the rackSerialNumber value. + */ + public String rackSerialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().rackSerialNumber(); + } + + /** + * Set the rackSerialNumber property: The globally unique identifier for the rack. + * + * @param rackSerialNumber the rackSerialNumber value to set. + * @return the RackPatchParameters object itself. + */ + public RackPatchParameters withRackSerialNumber(String rackSerialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new RacksPatchProperties(); + } + this.innerProperties().withRackSerialNumber(rackSerialNumber); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java new file mode 100644 index 000000000000..a85bda5be544 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the rack resource. */ +public final class RackProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for RackProvisioningState. */ + public static final RackProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for RackProvisioningState. */ + public static final RackProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for RackProvisioningState. */ + public static final RackProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for RackProvisioningState. */ + public static final RackProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for RackProvisioningState. */ + public static final RackProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of RackProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RackProvisioningState() { + } + + /** + * Creates or finds a RackProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RackProvisioningState. + */ + @JsonCreator + public static RackProvisioningState fromString(String name) { + return fromString(name, RackProvisioningState.class); + } + + /** + * Gets known RackProvisioningState values. + * + * @return known RackProvisioningState values. + */ + public static Collection values() { + return values(RackProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java new file mode 100644 index 000000000000..c9854e67f111 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSku.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; +import java.util.List; + +/** An immutable client-side representation of RackSku. */ +public interface RackSku { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the computeMachines property: The list of machine SKUs and associated rack slot for the compute-dedicated + * machines in this rack model. + * + * @return the computeMachines value. + */ + List computeMachines(); + + /** + * Gets the controllerMachines property: The list of machine SKUs and associated rack slot for the control-plane + * dedicated machines in this rack model. + * + * @return the controllerMachines value. + */ + List controllerMachines(); + + /** + * Gets the description property: The free-form text describing the rack. + * + * @return the description value. + */ + String description(); + + /** + * Gets the maxClusterSlots property: The maximum number of compute racks supported by an aggregator rack. 0 if this + * is a compute rack or a rack for a single rack cluster(rackType="Single"). + * + * @return the maxClusterSlots value. + */ + Long maxClusterSlots(); + + /** + * Gets the provisioningState property: The provisioning state of the rack SKU resource. + * + * @return the provisioningState value. + */ + RackSkuProvisioningState provisioningState(); + + /** + * Gets the rackType property: The type of the rack. + * + * @return the rackType value. + */ + RackSkuType rackType(); + + /** + * Gets the storageAppliances property: The list of appliance SKUs and associated rack slot for the storage + * appliance(s) in this rack model. + * + * @return the storageAppliances value. + */ + List storageAppliances(); + + /** + * Gets the supportedRackSkuIds property: The list of supported SKUs if the rack is an aggregator. + * + * @return the supportedRackSkuIds value. + */ + List supportedRackSkuIds(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner object. + * + * @return the inner object. + */ + RackSkuInner innerModel(); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java new file mode 100644 index 000000000000..b7a96c5881c3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.RackSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** RackSkuList represents a list of rack SKUs. */ +@Fluent +public final class RackSkuList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of Rack SKUs. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of RackSkuList class. */ + public RackSkuList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the RackSkuList object itself. + */ + public RackSkuList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of Rack SKUs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Rack SKUs. + * + * @param value the value value to set. + * @return the RackSkuList object itself. + */ + public RackSkuList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java new file mode 100644 index 000000000000..8dd77b3f9b4f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuProvisioningState.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the rack SKU resource. */ +public final class RackSkuProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for RackSkuProvisioningState. */ + public static final RackSkuProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of RackSkuProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RackSkuProvisioningState() { + } + + /** + * Creates or finds a RackSkuProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RackSkuProvisioningState. + */ + @JsonCreator + public static RackSkuProvisioningState fromString(String name) { + return fromString(name, RackSkuProvisioningState.class); + } + + /** + * Gets known RackSkuProvisioningState values. + * + * @return known RackSkuProvisioningState values. + */ + public static Collection values() { + return values(RackSkuProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java new file mode 100644 index 000000000000..c83694387490 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkuType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the rack. */ +public final class RackSkuType extends ExpandableStringEnum { + /** Static value Aggregator for RackSkuType. */ + public static final RackSkuType AGGREGATOR = fromString("Aggregator"); + + /** Static value Compute for RackSkuType. */ + public static final RackSkuType COMPUTE = fromString("Compute"); + + /** Static value Single for RackSkuType. */ + public static final RackSkuType SINGLE = fromString("Single"); + + /** + * Creates a new instance of RackSkuType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RackSkuType() { + } + + /** + * Creates or finds a RackSkuType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RackSkuType. + */ + @JsonCreator + public static RackSkuType fromString(String name) { + return fromString(name, RackSkuType.class); + } + + /** + * Gets known RackSkuType values. + * + * @return known RackSkuType values. + */ + public static Collection values() { + return values(RackSkuType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java new file mode 100644 index 000000000000..5f2471ad4b25 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RackSkus.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RackSkus. */ +public interface RackSkus { + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List rack SKUs in the subscription. + * + *

Get a list of rack SKUs in the provided subscription. + * + * @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 a list of rack SKUs in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU along with {@link Response}. + */ + Response getWithResponse(String rackSkuName, Context context); + + /** + * Retrieve the rack SKU. + * + *

Get the properties of the provided rack SKU. + * + * @param rackSkuName The name of the rack SKU. + * @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 properties of the provided rack SKU. + */ + RackSku get(String rackSkuName); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java new file mode 100644 index 000000000000..6154c42700e4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Racks.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Racks. */ +public interface Racks { + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 a list of racks in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List racks in the subscription. + * + *

Get a list of racks in the provided subscription. + * + * @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 a list of racks in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of racks in the provided resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List racks in the resource group. + * + *

Get a list of racks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of racks in the provided resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String rackName, Context context); + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 properties of the provided rack. + */ + Rack getByResourceGroup(String resourceGroupName, String rackName); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 deleteByResourceGroup(String resourceGroupName, String rackName); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param rackName The name of the rack. + * @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 delete(String resourceGroupName, String rackName, Context context); + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param id the resource ID. + * @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 properties of the provided rack along with {@link Response}. + */ + Rack getById(String id); + + /** + * Retrieve the rack. + * + *

Get properties of the provided rack. + * + * @param id the resource ID. + * @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 properties of the provided rack along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the rack. + * + *

Delete the provided rack. All customer initiated requests will be rejected as the life cycle of this resource + * is managed by the system. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Rack resource. + * + * @param name resource name. + * @return the first stage of the new Rack definition. + */ + Rack.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.java new file mode 100644 index 000000000000..ac40894cb5cf --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementFeature.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the storage appliance supports remote vendor management. */ +public final class RemoteVendorManagementFeature extends ExpandableStringEnum { + /** Static value Supported for RemoteVendorManagementFeature. */ + public static final RemoteVendorManagementFeature SUPPORTED = fromString("Supported"); + + /** Static value Unsupported for RemoteVendorManagementFeature. */ + public static final RemoteVendorManagementFeature UNSUPPORTED = fromString("Unsupported"); + + /** + * Creates a new instance of RemoteVendorManagementFeature value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RemoteVendorManagementFeature() { + } + + /** + * Creates or finds a RemoteVendorManagementFeature from its string representation. + * + * @param name a name to look for. + * @return the corresponding RemoteVendorManagementFeature. + */ + @JsonCreator + public static RemoteVendorManagementFeature fromString(String name) { + return fromString(name, RemoteVendorManagementFeature.class); + } + + /** + * Gets known RemoteVendorManagementFeature values. + * + * @return known RemoteVendorManagementFeature values. + */ + public static Collection values() { + return values(RemoteVendorManagementFeature.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java new file mode 100644 index 000000000000..0e9f92e02a1d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/RemoteVendorManagementStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an + * unsupported feature. + */ +public final class RemoteVendorManagementStatus extends ExpandableStringEnum { + /** Static value Enabled for RemoteVendorManagementStatus. */ + public static final RemoteVendorManagementStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for RemoteVendorManagementStatus. */ + public static final RemoteVendorManagementStatus DISABLED = fromString("Disabled"); + + /** Static value Unsupported for RemoteVendorManagementStatus. */ + public static final RemoteVendorManagementStatus UNSUPPORTED = fromString("Unsupported"); + + /** + * Creates a new instance of RemoteVendorManagementStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RemoteVendorManagementStatus() { + } + + /** + * Creates or finds a RemoteVendorManagementStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RemoteVendorManagementStatus. + */ + @JsonCreator + public static RemoteVendorManagementStatus fromString(String name) { + return fromString(name, RemoteVendorManagementStatus.class); + } + + /** + * Gets known RemoteVendorManagementStatus values. + * + * @return known RemoteVendorManagementStatus values. + */ + public static Collection values() { + return values(RemoteVendorManagementStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java new file mode 100644 index 000000000000..57396b8d4874 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ServicePrincipalInformation.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc + * Appliance installation. + */ +@Fluent +public final class ServicePrincipalInformation { + /* + * The application ID, also known as client ID, of the service principal. + */ + @JsonProperty(value = "applicationId", required = true) + private String applicationId; + + /* + * The password of the service principal. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /* + * The principal ID, also known as the object ID, of the service principal. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /** Creates an instance of ServicePrincipalInformation class. */ + public ServicePrincipalInformation() { + } + + /** + * Get the applicationId property: The application ID, also known as client ID, of the service principal. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The application ID, also known as client ID, of the service principal. + * + * @param applicationId the applicationId value to set. + * @return the ServicePrincipalInformation object itself. + */ + public ServicePrincipalInformation withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the password property: The password of the service principal. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the service principal. + * + * @param password the password value to set. + * @return the ServicePrincipalInformation object itself. + */ + public ServicePrincipalInformation withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the principalId property: The principal ID, also known as the object ID, of the service principal. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID, also known as the object ID, of the service principal. + * + * @param principalId the principalId value to set. + * @return the ServicePrincipalInformation object itself. + */ + public ServicePrincipalInformation withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID, also known as the directory ID, of the tenant in which the service + * principal is created. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID, also known as the directory ID, of the tenant in which the service + * principal is created. + * + * @param tenantId the tenantId value to set. + * @return the ServicePrincipalInformation object itself. + */ + public ServicePrincipalInformation withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationId in model ServicePrincipalInformation")); + } + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model ServicePrincipalInformation")); + } + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model ServicePrincipalInformation")); + } + if (tenantId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property tenantId in model ServicePrincipalInformation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServicePrincipalInformation.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.java new file mode 100644 index 000000000000..7613464ea9ce --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SkipShutdown.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. */ +public final class SkipShutdown extends ExpandableStringEnum { + /** Static value True for SkipShutdown. */ + public static final SkipShutdown TRUE = fromString("True"); + + /** Static value False for SkipShutdown. */ + public static final SkipShutdown FALSE = fromString("False"); + + /** + * Creates a new instance of SkipShutdown value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkipShutdown() { + } + + /** + * Creates or finds a SkipShutdown from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkipShutdown. + */ + @JsonCreator + public static SkipShutdown fromString(String name) { + return fromString(name, SkipShutdown.class); + } + + /** + * Gets known SkipShutdown values. + * + * @return known SkipShutdown values. + */ + public static Collection values() { + return values(SkipShutdown.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java new file mode 100644 index 000000000000..53dc704b2944 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/SshPublicKey.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SshPublicKey represents the public key used to authenticate with the virtual machine through SSH. */ +@Fluent +public final class SshPublicKey { + /* + * The public ssh key of the user. + */ + @JsonProperty(value = "keyData", required = true) + private String keyData; + + /** Creates an instance of SshPublicKey class. */ + public SshPublicKey() { + } + + /** + * Get the keyData property: The public ssh key of the user. + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: The public ssh key of the user. + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyData in model SshPublicKey")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SshPublicKey.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java new file mode 100644 index 000000000000..388465aa1667 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliance.java @@ -0,0 +1,506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner; +import java.util.Map; + +/** An immutable client-side representation of StorageAppliance. */ +public interface StorageAppliance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the administratorCredentials property: AdministrativeCredentials represents the admin credentials for the + * device requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @return the administratorCredentials value. + */ + AdministrativeCredentials administratorCredentials(); + + /** + * Gets the capacity property: The total capacity of the storage appliance. + * + * @return the capacity value. + */ + Long capacity(); + + /** + * Gets the capacityUsed property: The amount of storage consumed. + * + * @return the capacityUsed value. + */ + Long capacityUsed(); + + /** + * Gets the clusterId property: The resource ID of the cluster this storage appliance is associated with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the detailedStatus property: The detailed status of the storage appliance. + * + * @return the detailedStatus value. + */ + StorageApplianceDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the managementIpv4Address property: The endpoint for the management interface of the storage appliance. + * + * @return the managementIpv4Address value. + */ + String managementIpv4Address(); + + /** + * Gets the provisioningState property: The provisioning state of the storage appliance. + * + * @return the provisioningState value. + */ + StorageApplianceProvisioningState provisioningState(); + + /** + * Gets the rackId property: The resource ID of the rack where this storage appliance resides. + * + * @return the rackId value. + */ + String rackId(); + + /** + * Gets the rackSlot property: The slot the storage appliance is in the rack based on the BOM configuration. + * + * @return the rackSlot value. + */ + long rackSlot(); + + /** + * Gets the remoteVendorManagementFeature property: The indicator of whether the storage appliance supports remote + * vendor management. + * + * @return the remoteVendorManagementFeature value. + */ + RemoteVendorManagementFeature remoteVendorManagementFeature(); + + /** + * Gets the remoteVendorManagementStatus property: The indicator of whether the remote vendor management feature is + * enabled or disabled, or unsupported if it is an unsupported feature. + * + * @return the remoteVendorManagementStatus value. + */ + RemoteVendorManagementStatus remoteVendorManagementStatus(); + + /** + * Gets the serialNumber property: The serial number for the storage appliance. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the storageApplianceSkuId property: The SKU for the storage appliance. + * + * @return the storageApplianceSkuId value. + */ + String storageApplianceSkuId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner object. + * + * @return the inner object. + */ + StorageApplianceInner innerModel(); + + /** The entirety of the StorageAppliance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAdministratorCredentials, + DefinitionStages.WithRackId, + DefinitionStages.WithRackSlot, + DefinitionStages.WithSerialNumber, + DefinitionStages.WithStorageApplianceSkuId, + DefinitionStages.WithCreate { + } + /** The StorageAppliance definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageAppliance definition. */ + interface Blank extends WithLocation { + } + /** The stage of the StorageAppliance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the StorageAppliance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the StorageAppliance definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithAdministratorCredentials withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the StorageAppliance definition allowing to specify administratorCredentials. */ + interface WithAdministratorCredentials { + /** + * Specifies the administratorCredentials property: AdministrativeCredentials represents the admin + * credentials for the device requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance.. + * + * @param administratorCredentials AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + *

The credentials of the administrative interface on this storage appliance. + * @return the next definition stage. + */ + WithRackId withAdministratorCredentials(AdministrativeCredentials administratorCredentials); + } + /** The stage of the StorageAppliance definition allowing to specify rackId. */ + interface WithRackId { + /** + * Specifies the rackId property: The resource ID of the rack where this storage appliance resides.. + * + * @param rackId The resource ID of the rack where this storage appliance resides. + * @return the next definition stage. + */ + WithRackSlot withRackId(String rackId); + } + /** The stage of the StorageAppliance definition allowing to specify rackSlot. */ + interface WithRackSlot { + /** + * Specifies the rackSlot property: The slot the storage appliance is in the rack based on the BOM + * configuration.. + * + * @param rackSlot The slot the storage appliance is in the rack based on the BOM configuration. + * @return the next definition stage. + */ + WithSerialNumber withRackSlot(long rackSlot); + } + /** The stage of the StorageAppliance definition allowing to specify serialNumber. */ + interface WithSerialNumber { + /** + * Specifies the serialNumber property: The serial number for the storage appliance.. + * + * @param serialNumber The serial number for the storage appliance. + * @return the next definition stage. + */ + WithStorageApplianceSkuId withSerialNumber(String serialNumber); + } + /** The stage of the StorageAppliance definition allowing to specify storageApplianceSkuId. */ + interface WithStorageApplianceSkuId { + /** + * Specifies the storageApplianceSkuId property: The SKU for the storage appliance.. + * + * @param storageApplianceSkuId The SKU for the storage appliance. + * @return the next definition stage. + */ + WithCreate withStorageApplianceSkuId(String storageApplianceSkuId); + } + /** + * The stage of the StorageAppliance 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.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageAppliance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageAppliance create(Context context); + } + /** The stage of the StorageAppliance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the StorageAppliance resource. + * + * @return the stage of resource update. + */ + StorageAppliance.Update update(); + + /** The template for StorageAppliance update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSerialNumber { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageAppliance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageAppliance apply(Context context); + } + /** The StorageAppliance update stages. */ + interface UpdateStages { + /** The stage of the StorageAppliance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the StorageAppliance update allowing to specify serialNumber. */ + interface WithSerialNumber { + /** + * Specifies the serialNumber property: The serial number for the storage appliance.. + * + * @param serialNumber The serial number for the storage appliance. + * @return the next definition stage. + */ + Update withSerialNumber(String serialNumber); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageAppliance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageAppliance refresh(Context context); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @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 disableRemoteVendorManagement(); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @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 disableRemoteVendorManagement(Context context); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @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 enableRemoteVendorManagement(); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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 enableRemoteVendorManagement( + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands(StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, Context context); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware(StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceCommandSpecification.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceCommandSpecification.java new file mode 100644 index 000000000000..1d2f09802f6a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceCommandSpecification.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.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * StorageApplianceCommandSpecification represents the read-only command and optional arguments to execute against a + * storage appliance. + */ +@Fluent +public final class StorageApplianceCommandSpecification { + /* + * The list of string arguments that will be passed to the script in order as separate arguments. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /* + * The read-only command to execute against the storage appliance. + */ + @JsonProperty(value = "command", required = true) + private String command; + + /** Creates an instance of StorageApplianceCommandSpecification class. */ + public StorageApplianceCommandSpecification() { + } + + /** + * Get the arguments property: The list of string arguments that will be passed to the script in order as separate + * arguments. + * + * @return the arguments value. + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The list of string arguments that will be passed to the script in order as separate + * arguments. + * + * @param arguments the arguments value to set. + * @return the StorageApplianceCommandSpecification object itself. + */ + public StorageApplianceCommandSpecification withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the command property: The read-only command to execute against the storage appliance. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The read-only command to execute against the storage appliance. + * + * @param command the command value to set. + * @return the StorageApplianceCommandSpecification object itself. + */ + public StorageApplianceCommandSpecification withCommand(String command) { + this.command = command; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (command() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property command in model StorageApplianceCommandSpecification")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceCommandSpecification.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java new file mode 100644 index 000000000000..6d41ce145e83 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceConfigurationData.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageApplianceConfigurationData represents configuration for the storage application. */ +@Fluent +public final class StorageApplianceConfigurationData { + /* + * AdministrativeCredentials represents the admin credentials for the device requiring password-based + * authentication. + * + * The credentials of the administrative interface on this storage appliance. + */ + @JsonProperty(value = "adminCredentials", required = true) + private AdministrativeCredentials adminCredentials; + + /* + * The slot that storage appliance is in the rack based on the BOM configuration. + */ + @JsonProperty(value = "rackSlot", required = true) + private long rackSlot; + + /* + * The serial number of the appliance. + */ + @JsonProperty(value = "serialNumber", required = true) + private String serialNumber; + + /* + * The user-provided name for the storage appliance that will be created from this specification. + */ + @JsonProperty(value = "storageApplianceName") + private String storageApplianceName; + + /** Creates an instance of StorageApplianceConfigurationData class. */ + public StorageApplianceConfigurationData() { + } + + /** + * Get the adminCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @return the adminCredentials value. + */ + public AdministrativeCredentials adminCredentials() { + return this.adminCredentials; + } + + /** + * Set the adminCredentials property: AdministrativeCredentials represents the admin credentials for the device + * requiring password-based authentication. + * + *

The credentials of the administrative interface on this storage appliance. + * + * @param adminCredentials the adminCredentials value to set. + * @return the StorageApplianceConfigurationData object itself. + */ + public StorageApplianceConfigurationData withAdminCredentials(AdministrativeCredentials adminCredentials) { + this.adminCredentials = adminCredentials; + return this; + } + + /** + * Get the rackSlot property: The slot that storage appliance is in the rack based on the BOM configuration. + * + * @return the rackSlot value. + */ + public long rackSlot() { + return this.rackSlot; + } + + /** + * Set the rackSlot property: The slot that storage appliance is in the rack based on the BOM configuration. + * + * @param rackSlot the rackSlot value to set. + * @return the StorageApplianceConfigurationData object itself. + */ + public StorageApplianceConfigurationData withRackSlot(long rackSlot) { + this.rackSlot = rackSlot; + return this; + } + + /** + * Get the serialNumber property: The serial number of the appliance. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: The serial number of the appliance. + * + * @param serialNumber the serialNumber value to set. + * @return the StorageApplianceConfigurationData object itself. + */ + public StorageApplianceConfigurationData withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the storageApplianceName property: The user-provided name for the storage appliance that will be created from + * this specification. + * + * @return the storageApplianceName value. + */ + public String storageApplianceName() { + return this.storageApplianceName; + } + + /** + * Set the storageApplianceName property: The user-provided name for the storage appliance that will be created from + * this specification. + * + * @param storageApplianceName the storageApplianceName value to set. + * @return the StorageApplianceConfigurationData object itself. + */ + public StorageApplianceConfigurationData withStorageApplianceName(String storageApplianceName) { + this.storageApplianceName = storageApplianceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminCredentials() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminCredentials in model StorageApplianceConfigurationData")); + } else { + adminCredentials().validate(); + } + if (serialNumber() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serialNumber in model StorageApplianceConfigurationData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceConfigurationData.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java new file mode 100644 index 000000000000..77c5a6fb010f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The detailed status of the storage appliance. */ +public final class StorageApplianceDetailedStatus extends ExpandableStringEnum { + /** Static value Error for StorageApplianceDetailedStatus. */ + public static final StorageApplianceDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for StorageApplianceDetailedStatus. */ + public static final StorageApplianceDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for StorageApplianceDetailedStatus. */ + public static final StorageApplianceDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of StorageApplianceDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageApplianceDetailedStatus() { + } + + /** + * Creates or finds a StorageApplianceDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageApplianceDetailedStatus. + */ + @JsonCreator + public static StorageApplianceDetailedStatus fromString(String name) { + return fromString(name, StorageApplianceDetailedStatus.class); + } + + /** + * Gets known StorageApplianceDetailedStatus values. + * + * @return known StorageApplianceDetailedStatus values. + */ + public static Collection values() { + return values(StorageApplianceDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java new file mode 100644 index 000000000000..e5b867d66a7b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceEnableRemoteVendorManagementParameters.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * StorageApplianceEnableRemoteVendorManagementParameters represents the body of the request to enable remote vendor + * management of a storage appliance. + */ +@Fluent +public final class StorageApplianceEnableRemoteVendorManagementParameters { + /* + * Field Deprecated. This field is not used and will be rejected if provided. The list of IPv4 subnets (in CIDR + * format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to + * turn on the remote vendor management. + */ + @JsonProperty(value = "supportEndpoints") + private List supportEndpoints; + + /** Creates an instance of StorageApplianceEnableRemoteVendorManagementParameters class. */ + public StorageApplianceEnableRemoteVendorManagementParameters() { + } + + /** + * Get the supportEndpoints property: Field Deprecated. This field is not used and will be rejected if provided. The + * list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance + * needs accessible in order to turn on the remote vendor management. + * + * @return the supportEndpoints value. + */ + public List supportEndpoints() { + return this.supportEndpoints; + } + + /** + * Set the supportEndpoints property: Field Deprecated. This field is not used and will be rejected if provided. The + * list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance + * needs accessible in order to turn on the remote vendor management. + * + * @param supportEndpoints the supportEndpoints value to set. + * @return the StorageApplianceEnableRemoteVendorManagementParameters object itself. + */ + public StorageApplianceEnableRemoteVendorManagementParameters withSupportEndpoints(List supportEndpoints) { + this.supportEndpoints = supportEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceHardwareValidationCategory.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceHardwareValidationCategory.java new file mode 100644 index 000000000000..4d7450670185 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceHardwareValidationCategory.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The category of hardware validation to perform. */ +public final class StorageApplianceHardwareValidationCategory + extends ExpandableStringEnum { + /** Static value BasicValidation for StorageApplianceHardwareValidationCategory. */ + public static final StorageApplianceHardwareValidationCategory BASIC_VALIDATION = fromString("BasicValidation"); + + /** + * Creates a new instance of StorageApplianceHardwareValidationCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageApplianceHardwareValidationCategory() { + } + + /** + * Creates or finds a StorageApplianceHardwareValidationCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageApplianceHardwareValidationCategory. + */ + @JsonCreator + public static StorageApplianceHardwareValidationCategory fromString(String name) { + return fromString(name, StorageApplianceHardwareValidationCategory.class); + } + + /** + * Gets known StorageApplianceHardwareValidationCategory values. + * + * @return known StorageApplianceHardwareValidationCategory values. + */ + public static Collection values() { + return values(StorageApplianceHardwareValidationCategory.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java new file mode 100644 index 000000000000..458a8b626def --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** StorageApplianceList represents a list of storage appliances. */ +@Fluent +public final class StorageApplianceList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of storage appliances. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of StorageApplianceList class. */ + public StorageApplianceList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the StorageApplianceList object itself. + */ + public StorageApplianceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of storage appliances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of storage appliances. + * + * @param value the value value to set. + * @return the StorageApplianceList object itself. + */ + public StorageApplianceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java new file mode 100644 index 000000000000..5f766ced025a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliancePatchParameters.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageAppliancePatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. */ +@Fluent +public final class StorageAppliancePatchParameters { + /* + * StorageAppliancePatchProperties represents the properties of the storage appliance that can be patched. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private StorageAppliancePatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of StorageAppliancePatchParameters class. */ + public StorageAppliancePatchParameters() { + } + + /** + * Get the innerProperties property: StorageAppliancePatchProperties represents the properties of the storage + * appliance that can be patched. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private StorageAppliancePatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the StorageAppliancePatchParameters object itself. + */ + public StorageAppliancePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the serialNumber property: The serial number for the storage appliance. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.innerProperties() == null ? null : this.innerProperties().serialNumber(); + } + + /** + * Set the serialNumber property: The serial number for the storage appliance. + * + * @param serialNumber the serialNumber value to set. + * @return the StorageAppliancePatchParameters object itself. + */ + public StorageAppliancePatchParameters withSerialNumber(String serialNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAppliancePatchProperties(); + } + this.innerProperties().withSerialNumber(serialNumber); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java new file mode 100644 index 000000000000..184664b16cac --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the storage appliance. */ +public final class StorageApplianceProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for StorageApplianceProvisioningState. */ + public static final StorageApplianceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for StorageApplianceProvisioningState. */ + public static final StorageApplianceProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for StorageApplianceProvisioningState. */ + public static final StorageApplianceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for StorageApplianceProvisioningState. */ + public static final StorageApplianceProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for StorageApplianceProvisioningState. */ + public static final StorageApplianceProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of StorageApplianceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageApplianceProvisioningState() { + } + + /** + * Creates or finds a StorageApplianceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageApplianceProvisioningState. + */ + @JsonCreator + public static StorageApplianceProvisioningState fromString(String name) { + return fromString(name, StorageApplianceProvisioningState.class); + } + + /** + * Gets known StorageApplianceProvisioningState values. + * + * @return known StorageApplianceProvisioningState values. + */ + public static Collection values() { + return values(StorageApplianceProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceRunReadCommandsParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceRunReadCommandsParameters.java new file mode 100644 index 000000000000..f93eaddae806 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceRunReadCommandsParameters.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * StorageApplianceRunReadCommandsParameters represents the body of request containing list of read-only commands to run + * for a storage appliance. + */ +@Fluent +public final class StorageApplianceRunReadCommandsParameters { + /* + * The list of read-only commands to run. + */ + @JsonProperty(value = "commands", required = true) + private List commands; + + /* + * The maximum time the commands are allowed to run. + * If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be + * captured, and the exit code matching a timeout will be returned (252). + */ + @JsonProperty(value = "limitTimeSeconds", required = true) + private long limitTimeSeconds; + + /** Creates an instance of StorageApplianceRunReadCommandsParameters class. */ + public StorageApplianceRunReadCommandsParameters() { + } + + /** + * Get the commands property: The list of read-only commands to run. + * + * @return the commands value. + */ + public List commands() { + return this.commands; + } + + /** + * Set the commands property: The list of read-only commands to run. + * + * @param commands the commands value to set. + * @return the StorageApplianceRunReadCommandsParameters object itself. + */ + public StorageApplianceRunReadCommandsParameters withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Get the limitTimeSeconds property: The maximum time the commands are allowed to run. If the execution time + * exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit + * code matching a timeout will be returned (252). + * + * @return the limitTimeSeconds value. + */ + public long limitTimeSeconds() { + return this.limitTimeSeconds; + } + + /** + * Set the limitTimeSeconds property: The maximum time the commands are allowed to run. If the execution time + * exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit + * code matching a timeout will be returned (252). + * + * @param limitTimeSeconds the limitTimeSeconds value to set. + * @return the StorageApplianceRunReadCommandsParameters object itself. + */ + public StorageApplianceRunReadCommandsParameters withLimitTimeSeconds(long limitTimeSeconds) { + this.limitTimeSeconds = limitTimeSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (commands() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property commands in model StorageApplianceRunReadCommandsParameters")); + } else { + commands().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceRunReadCommandsParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java new file mode 100644 index 000000000000..723c89c1552d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceSkuSlot.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.networkcloud.fluent.models.StorageApplianceSkuProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. */ +@Immutable +public final class StorageApplianceSkuSlot { + /* + * StorageApplianceSkuProperties represents the properties of the storage appliance SKU. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private StorageApplianceSkuProperties innerProperties; + + /* + * The position in the rack for the storage appliance. + */ + @JsonProperty(value = "rackSlot", access = JsonProperty.Access.WRITE_ONLY) + private Long rackSlot; + + /** Creates an instance of StorageApplianceSkuSlot class. */ + public StorageApplianceSkuSlot() { + } + + /** + * Get the innerProperties property: StorageApplianceSkuProperties represents the properties of the storage + * appliance SKU. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private StorageApplianceSkuProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the rackSlot property: The position in the rack for the storage appliance. + * + * @return the rackSlot value. + */ + public Long rackSlot() { + return this.rackSlot; + } + + /** + * Get the capacityGB property: The maximum capacity of the storage appliance. + * + * @return the capacityGB value. + */ + public Long capacityGB() { + return this.innerProperties() == null ? null : this.innerProperties().capacityGB(); + } + + /** + * Get the model property: The model of the storage appliance. + * + * @return the model value. + */ + public String model() { + return this.innerProperties() == null ? null : this.innerProperties().model(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceValidateHardwareParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceValidateHardwareParameters.java new file mode 100644 index 000000000000..32c74fed6781 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageApplianceValidateHardwareParameters.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * StorageApplianceValidateHardwareParameters represents the body of the request to validate the physical hardware of a + * storage appliance. + */ +@Fluent +public final class StorageApplianceValidateHardwareParameters { + /* + * The category of hardware validation to perform. + */ + @JsonProperty(value = "validationCategory", required = true) + private StorageApplianceHardwareValidationCategory validationCategory; + + /** Creates an instance of StorageApplianceValidateHardwareParameters class. */ + public StorageApplianceValidateHardwareParameters() { + } + + /** + * Get the validationCategory property: The category of hardware validation to perform. + * + * @return the validationCategory value. + */ + public StorageApplianceHardwareValidationCategory validationCategory() { + return this.validationCategory; + } + + /** + * Set the validationCategory property: The category of hardware validation to perform. + * + * @param validationCategory the validationCategory value to set. + * @return the StorageApplianceValidateHardwareParameters object itself. + */ + public StorageApplianceValidateHardwareParameters withValidationCategory( + StorageApplianceHardwareValidationCategory validationCategory) { + this.validationCategory = validationCategory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationCategory() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property validationCategory in model" + + " StorageApplianceValidateHardwareParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceValidateHardwareParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java new file mode 100644 index 000000000000..7f39ded63ceb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageAppliances.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of StorageAppliances. */ +public interface StorageAppliances { + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 a list of storage appliances in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * List storage appliances in the subscription. + * + *

Get a list of storage appliances in the provided subscription. + * + * @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 a list of storage appliances in the provided subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of storage appliances in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List storage appliances in the resource group. + * + *

Get a list of storage appliances in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of storage appliances in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String storageApplianceName, Context context); + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 properties of the provided storage appliance. + */ + StorageAppliance getByResourceGroup(String resourceGroupName, String storageApplianceName); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 deleteByResourceGroup(String resourceGroupName, String storageApplianceName); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 delete(String resourceGroupName, String storageApplianceName, Context context); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName); + + /** + * Turn off remote vendor management for a storage appliance, if supported. + * + *

Disable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 disableRemoteVendorManagement(String resourceGroupName, String storageApplianceName, Context context); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @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 enableRemoteVendorManagement(String resourceGroupName, String storageApplianceName); + + /** + * Turn on remote vendor management for a storage appliance, if supported. + * + *

Enable remote vendor management of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceEnableRemoteVendorManagementParameters The request body. + * @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 enableRemoteVendorManagement( + String resourceGroupName, + String storageApplianceName, + StorageApplianceEnableRemoteVendorManagementParameters storageApplianceEnableRemoteVendorManagementParameters, + Context context); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters); + + /** + * Retrieve output from read-only commands exercised against a storage appliance. + * + *

Run and retrieve output from read only commands on the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceRunReadCommandsParameters The request body. + * @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 runReadCommands( + String resourceGroupName, + String storageApplianceName, + StorageApplianceRunReadCommandsParameters storageApplianceRunReadCommandsParameters, + Context context); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters); + + /** + * Trigger hardware validation of the storage appliance. + * + *

Validate the hardware of the provided storage appliance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageApplianceName The name of the storage appliance. + * @param storageApplianceValidateHardwareParameters The request body. + * @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 validateHardware( + String resourceGroupName, + String storageApplianceName, + StorageApplianceValidateHardwareParameters storageApplianceValidateHardwareParameters, + Context context); + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param id the resource ID. + * @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 properties of the provided storage appliance along with {@link Response}. + */ + StorageAppliance getById(String id); + + /** + * Retrieve the storage appliance. + * + *

Get properties of the provided storage appliance. + * + * @param id the resource ID. + * @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 properties of the provided storage appliance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the storage appliance. + * + *

Delete the provided storage appliance. All customer initiated requests will be rejected as the life cycle of + * this resource is managed by the system. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageAppliance resource. + * + * @param name resource name. + * @return the first stage of the new StorageAppliance definition. + */ + StorageAppliance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java new file mode 100644 index 000000000000..72a9dc540650 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/StorageProfile.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** StorageProfile represents information about a disk. */ +@Fluent +public final class StorageProfile { + /* + * OsDisk represents configuration of the boot disk. + * + * The disk to use with this virtual machine. + */ + @JsonProperty(value = "osDisk", required = true) + private OsDisk osDisk; + + /* + * The resource IDs of volumes that are requested to be attached to the virtual machine. + */ + @JsonProperty(value = "volumeAttachments") + private List volumeAttachments; + + /** Creates an instance of StorageProfile class. */ + public StorageProfile() { + } + + /** + * Get the osDisk property: OsDisk represents configuration of the boot disk. + * + *

The disk to use with this virtual machine. + * + * @return the osDisk value. + */ + public OsDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk property: OsDisk represents configuration of the boot disk. + * + *

The disk to use with this virtual machine. + * + * @param osDisk the osDisk value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withOsDisk(OsDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the volumeAttachments property: The resource IDs of volumes that are requested to be attached to the virtual + * machine. + * + * @return the volumeAttachments value. + */ + public List volumeAttachments() { + return this.volumeAttachments; + } + + /** + * Set the volumeAttachments property: The resource IDs of volumes that are requested to be attached to the virtual + * machine. + * + * @param volumeAttachments the volumeAttachments value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withVolumeAttachments(List volumeAttachments) { + this.volumeAttachments = volumeAttachments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osDisk() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osDisk in model StorageProfile")); + } else { + osDisk().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageProfile.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java new file mode 100644 index 000000000000..14c788f52024 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetwork.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of TrunkedNetwork. */ +public interface TrunkedNetwork { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated + * with. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the detailedStatus property: The more detailed status of the trunked network. + * + * @return the detailedStatus value. + */ + TrunkedNetworkDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the hybridAksClustersAssociatedIds property: The list of Hybrid AKS cluster resource IDs that are associated + * with this trunked network. + * + * @return the hybridAksClustersAssociatedIds value. + */ + List hybridAksClustersAssociatedIds(); + + /** + * Gets the hybridAksPluginType property: The network plugin type for Hybrid AKS. + * + * @return the hybridAksPluginType value. + */ + HybridAksPluginType hybridAksPluginType(); + + /** + * Gets the interfaceName property: The default interface name for this trunked network in the virtual machine. This + * name can be overridden by the name supplied in the network attachment configuration of that virtual machine. + * + * @return the interfaceName value. + */ + String interfaceName(); + + /** + * Gets the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains. + * It can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * + * @return the isolationDomainIds value. + */ + List isolationDomainIds(); + + /** + * Gets the provisioningState property: The provisioning state of the trunked network. + * + * @return the provisioningState value. + */ + TrunkedNetworkProvisioningState provisioningState(); + + /** + * Gets the virtualMachinesAssociatedIds property: The list of virtual machine resource IDs, excluding any Hybrid + * AKS virtual machines, that are currently using this trunked network. + * + * @return the virtualMachinesAssociatedIds value. + */ + List virtualMachinesAssociatedIds(); + + /** + * Gets the vlans property: The list of vlans that are selected from the isolation domains for trunking. + * + * @return the vlans value. + */ + List vlans(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner object. + * + * @return the inner object. + */ + TrunkedNetworkInner innerModel(); + + /** The entirety of the TrunkedNetwork definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithIsolationDomainIds, + DefinitionStages.WithVlans, + DefinitionStages.WithCreate { + } + /** The TrunkedNetwork definition stages. */ + interface DefinitionStages { + /** The first stage of the TrunkedNetwork definition. */ + interface Blank extends WithLocation { + } + /** The stage of the TrunkedNetwork definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the TrunkedNetwork definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the TrunkedNetwork definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithIsolationDomainIds withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the TrunkedNetwork definition allowing to specify isolationDomainIds. */ + interface WithIsolationDomainIds { + /** + * Specifies the isolationDomainIds property: The list of resource IDs representing the Network Fabric + * isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.. + * + * @param isolationDomainIds The list of resource IDs representing the Network Fabric isolation domains. It + * can be any combination of l2IsolationDomain and l3IsolationDomain resources. + * @return the next definition stage. + */ + WithVlans withIsolationDomainIds(List isolationDomainIds); + } + /** The stage of the TrunkedNetwork definition allowing to specify vlans. */ + interface WithVlans { + /** + * Specifies the vlans property: The list of vlans that are selected from the isolation domains for + * trunking.. + * + * @param vlans The list of vlans that are selected from the isolation domains for trunking. + * @return the next definition stage. + */ + WithCreate withVlans(List vlans); + } + /** + * The stage of the TrunkedNetwork 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.WithTags, + DefinitionStages.WithHybridAksPluginType, + DefinitionStages.WithInterfaceName { + /** + * Executes the create request. + * + * @return the created resource. + */ + TrunkedNetwork create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TrunkedNetwork create(Context context); + } + /** The stage of the TrunkedNetwork definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the TrunkedNetwork definition allowing to specify hybridAksPluginType. */ + interface WithHybridAksPluginType { + /** + * Specifies the hybridAksPluginType property: The network plugin type for Hybrid AKS.. + * + * @param hybridAksPluginType The network plugin type for Hybrid AKS. + * @return the next definition stage. + */ + WithCreate withHybridAksPluginType(HybridAksPluginType hybridAksPluginType); + } + /** The stage of the TrunkedNetwork definition allowing to specify interfaceName. */ + interface WithInterfaceName { + /** + * Specifies the interfaceName property: The default interface name for this trunked network in the virtual + * machine. This name can be overridden by the name supplied in the network attachment configuration of that + * virtual machine.. + * + * @param interfaceName The default interface name for this trunked network in the virtual machine. This + * name can be overridden by the name supplied in the network attachment configuration of that virtual + * machine. + * @return the next definition stage. + */ + WithCreate withInterfaceName(String interfaceName); + } + } + /** + * Begins update for the TrunkedNetwork resource. + * + * @return the stage of resource update. + */ + TrunkedNetwork.Update update(); + + /** The template for TrunkedNetwork update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TrunkedNetwork apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TrunkedNetwork apply(Context context); + } + /** The TrunkedNetwork update stages. */ + interface UpdateStages { + /** The stage of the TrunkedNetwork update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TrunkedNetwork refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TrunkedNetwork refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java new file mode 100644 index 000000000000..a090bdc91187 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the trunked network. */ +public final class TrunkedNetworkDetailedStatus extends ExpandableStringEnum { + /** Static value Error for TrunkedNetworkDetailedStatus. */ + public static final TrunkedNetworkDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for TrunkedNetworkDetailedStatus. */ + public static final TrunkedNetworkDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for TrunkedNetworkDetailedStatus. */ + public static final TrunkedNetworkDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of TrunkedNetworkDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrunkedNetworkDetailedStatus() { + } + + /** + * Creates or finds a TrunkedNetworkDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrunkedNetworkDetailedStatus. + */ + @JsonCreator + public static TrunkedNetworkDetailedStatus fromString(String name) { + return fromString(name, TrunkedNetworkDetailedStatus.class); + } + + /** + * Gets known TrunkedNetworkDetailedStatus values. + * + * @return known TrunkedNetworkDetailedStatus values. + */ + public static Collection values() { + return values(TrunkedNetworkDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java new file mode 100644 index 000000000000..4f184604726a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.TrunkedNetworkInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** TrunkedNetworkList represents a list of trunked networks. */ +@Fluent +public final class TrunkedNetworkList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of trunked networks. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of TrunkedNetworkList class. */ + public TrunkedNetworkList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the TrunkedNetworkList object itself. + */ + public TrunkedNetworkList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of trunked networks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of trunked networks. + * + * @param value the value value to set. + * @return the TrunkedNetworkList object itself. + */ + public TrunkedNetworkList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java new file mode 100644 index 000000000000..708afa433d56 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkPatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. */ +@Fluent +public final class TrunkedNetworkPatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of TrunkedNetworkPatchParameters class. */ + public TrunkedNetworkPatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the TrunkedNetworkPatchParameters object itself. + */ + public TrunkedNetworkPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java new file mode 100644 index 000000000000..d24fe21e6c09 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworkProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the trunked network. */ +public final class TrunkedNetworkProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for TrunkedNetworkProvisioningState. */ + public static final TrunkedNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for TrunkedNetworkProvisioningState. */ + public static final TrunkedNetworkProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for TrunkedNetworkProvisioningState. */ + public static final TrunkedNetworkProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for TrunkedNetworkProvisioningState. */ + public static final TrunkedNetworkProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for TrunkedNetworkProvisioningState. */ + public static final TrunkedNetworkProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of TrunkedNetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrunkedNetworkProvisioningState() { + } + + /** + * Creates or finds a TrunkedNetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrunkedNetworkProvisioningState. + */ + @JsonCreator + public static TrunkedNetworkProvisioningState fromString(String name) { + return fromString(name, TrunkedNetworkProvisioningState.class); + } + + /** + * Gets known TrunkedNetworkProvisioningState values. + * + * @return known TrunkedNetworkProvisioningState values. + */ + public static Collection values() { + return values(TrunkedNetworkProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java new file mode 100644 index 000000000000..6f1f8b065a6a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/TrunkedNetworks.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TrunkedNetworks. */ +public interface TrunkedNetworks { + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List trunked networks in the subscription. + * + *

Get a list of trunked networks in the provided subscription. + * + * @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 a list of trunked networks in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of trunked networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List trunked networks in the resource group. + * + *

Get a list of trunked networks in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of trunked networks in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String trunkedNetworkName, Context context); + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 properties of the provided trunked network. + */ + TrunkedNetwork getByResourceGroup(String resourceGroupName, String trunkedNetworkName); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 deleteByResourceGroup(String resourceGroupName, String trunkedNetworkName); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param trunkedNetworkName The name of the trunked network. + * @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 delete(String resourceGroupName, String trunkedNetworkName, Context context); + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param id the resource ID. + * @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 properties of the provided trunked network along with {@link Response}. + */ + TrunkedNetwork getById(String id); + + /** + * Retrieve the trunked network. + * + *

Get properties of the provided trunked network. + * + * @param id the resource ID. + * @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 properties of the provided trunked network along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the trunked network. + * + *

Delete the provided trunked network. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TrunkedNetwork resource. + * + * @param name resource name. + * @return the first stage of the new TrunkedNetwork definition. + */ + TrunkedNetwork.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java new file mode 100644 index 000000000000..7b1809d96f2a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThreshold.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ValidationThreshold indicates allowed machine and node hardware and deployment failures. */ +@Fluent +public final class ValidationThreshold { + /* + * Selection of how the type evaluation is applied to the cluster calculation. + */ + @JsonProperty(value = "grouping", required = true) + private ValidationThresholdGrouping grouping; + + /* + * Selection of how the threshold should be evaluated. + */ + @JsonProperty(value = "type", required = true) + private ValidationThresholdType type; + + /* + * The numeric threshold value. + */ + @JsonProperty(value = "value", required = true) + private long value; + + /** Creates an instance of ValidationThreshold class. */ + public ValidationThreshold() { + } + + /** + * Get the grouping property: Selection of how the type evaluation is applied to the cluster calculation. + * + * @return the grouping value. + */ + public ValidationThresholdGrouping grouping() { + return this.grouping; + } + + /** + * Set the grouping property: Selection of how the type evaluation is applied to the cluster calculation. + * + * @param grouping the grouping value to set. + * @return the ValidationThreshold object itself. + */ + public ValidationThreshold withGrouping(ValidationThresholdGrouping grouping) { + this.grouping = grouping; + return this; + } + + /** + * Get the type property: Selection of how the threshold should be evaluated. + * + * @return the type value. + */ + public ValidationThresholdType type() { + return this.type; + } + + /** + * Set the type property: Selection of how the threshold should be evaluated. + * + * @param type the type value to set. + * @return the ValidationThreshold object itself. + */ + public ValidationThreshold withType(ValidationThresholdType type) { + this.type = type; + return this; + } + + /** + * Get the value property: The numeric threshold value. + * + * @return the value value. + */ + public long value() { + return this.value; + } + + /** + * Set the value property: The numeric threshold value. + * + * @param value the value value to set. + * @return the ValidationThreshold object itself. + */ + public ValidationThreshold withValue(long value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (grouping() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property grouping in model ValidationThreshold")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ValidationThreshold")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ValidationThreshold.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.java new file mode 100644 index 000000000000..4c09228d2e8d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdGrouping.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Selection of how the type evaluation is applied to the cluster calculation. */ +public final class ValidationThresholdGrouping extends ExpandableStringEnum { + /** Static value PerCluster for ValidationThresholdGrouping. */ + public static final ValidationThresholdGrouping PER_CLUSTER = fromString("PerCluster"); + + /** Static value PerRack for ValidationThresholdGrouping. */ + public static final ValidationThresholdGrouping PER_RACK = fromString("PerRack"); + + /** + * Creates a new instance of ValidationThresholdGrouping value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationThresholdGrouping() { + } + + /** + * Creates or finds a ValidationThresholdGrouping from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationThresholdGrouping. + */ + @JsonCreator + public static ValidationThresholdGrouping fromString(String name) { + return fromString(name, ValidationThresholdGrouping.class); + } + + /** + * Gets known ValidationThresholdGrouping values. + * + * @return known ValidationThresholdGrouping values. + */ + public static Collection values() { + return values(ValidationThresholdGrouping.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.java new file mode 100644 index 000000000000..59b5a9e9c756 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/ValidationThresholdType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Selection of how the threshold should be evaluated. */ +public final class ValidationThresholdType extends ExpandableStringEnum { + /** Static value CountSuccess for ValidationThresholdType. */ + public static final ValidationThresholdType COUNT_SUCCESS = fromString("CountSuccess"); + + /** Static value PercentSuccess for ValidationThresholdType. */ + public static final ValidationThresholdType PERCENT_SUCCESS = fromString("PercentSuccess"); + + /** + * Creates a new instance of ValidationThresholdType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationThresholdType() { + } + + /** + * Creates or finds a ValidationThresholdType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationThresholdType. + */ + @JsonCreator + public static ValidationThresholdType fromString(String name) { + return fromString(name, ValidationThresholdType.class); + } + + /** + * Gets known ValidationThresholdType values. + * + * @return known ValidationThresholdType values. + */ + public static Collection values() { + return values(ValidationThresholdType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java new file mode 100644 index 000000000000..c53732e7c419 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachine.java @@ -0,0 +1,765 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of VirtualMachine. */ +public interface VirtualMachine { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the adminUsername property: The name of the administrator to which the ssh public keys will be added into + * the authorized keys. + * + * @return the adminUsername value. + */ + String adminUsername(); + + /** + * Gets the bareMetalMachineId property: The resource ID of the bare metal machine the virtual machine has landed + * to. + * + * @return the bareMetalMachineId value. + */ + String bareMetalMachineId(); + + /** + * Gets the bootMethod property: Selects the boot method for the virtual machine. + * + * @return the bootMethod value. + */ + VirtualMachineBootMethod bootMethod(); + + /** + * Gets the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network attachment. + * + *

The cloud service network that provides platform-level services for the virtual machine. + * + * @return the cloudServicesNetworkAttachment value. + */ + NetworkAttachment cloudServicesNetworkAttachment(); + + /** + * Gets the clusterId property: The resource ID of the cluster the virtual machine is created for. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the cpuCores property: The number of CPU cores in the virtual machine. + * + * @return the cpuCores value. + */ + long cpuCores(); + + /** + * Gets the detailedStatus property: The more detailed status of the virtual machine. + * + * @return the detailedStatus value. + */ + VirtualMachineDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. The indicator + * of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. + * + * @return the isolateEmulatorThread value. + */ + VirtualMachineIsolateEmulatorThread isolateEmulatorThread(); + + /** + * Gets the memorySizeGB property: The memory size of the virtual machine in GB. + * + * @return the memorySizeGB value. + */ + long memorySizeGB(); + + /** + * Gets the networkAttachments property: The list of network attachments to the virtual machine. + * + * @return the networkAttachments value. + */ + List networkAttachments(); + + /** + * Gets the networkData property: The Base64 encoded cloud-init network data. + * + * @return the networkData value. + */ + String networkData(); + + /** + * Gets the placementHints property: The scheduling hints for the virtual machine. + * + * @return the placementHints value. + */ + List placementHints(); + + /** + * Gets the powerState property: The power state of the virtual machine. + * + * @return the powerState value. + */ + VirtualMachinePowerState powerState(); + + /** + * Gets the provisioningState property: The provisioning state of the virtual machine. + * + * @return the provisioningState value. + */ + VirtualMachineProvisioningState provisioningState(); + + /** + * Gets the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual machine using + * the cloud-init ssh_authorized_keys mechanism for the adminUsername. + * + * @return the sshPublicKeys value. + */ + List sshPublicKeys(); + + /** + * Gets the storageProfile property: StorageProfile represents information about a disk. + * + *

The storage profile that specifies size and other parameters about the disks related to the virtual machine. + * + * @return the storageProfile value. + */ + StorageProfile storageProfile(); + + /** + * Gets the userData property: The Base64 encoded cloud-init user data. + * + * @return the userData value. + */ + String userData(); + + /** + * Gets the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of the virtio + * interface. + * + * @return the virtioInterface value. + */ + VirtualMachineVirtioInterfaceType virtioInterface(); + + /** + * Gets the vmDeviceModel property: The type of the device model to use. + * + * @return the vmDeviceModel value. + */ + VirtualMachineDeviceModelType vmDeviceModel(); + + /** + * Gets the vmImage property: The virtual machine image that is currently provisioned to the OS disk, using the full + * url and tag notation used to pull the image. + * + * @return the vmImage value. + */ + String vmImage(); + + /** + * Gets the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @return the vmImageRepositoryCredentials value. + */ + ImageRepositoryCredentials vmImageRepositoryCredentials(); + + /** + * Gets the volumes property: The resource IDs of volumes that are attached to the virtual machine. + * + * @return the volumes value. + */ + List volumes(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner object. + * + * @return the inner object. + */ + VirtualMachineInner innerModel(); + + /** The entirety of the VirtualMachine definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithAdminUsername, + DefinitionStages.WithCloudServicesNetworkAttachment, + DefinitionStages.WithCpuCores, + DefinitionStages.WithMemorySizeGB, + DefinitionStages.WithStorageProfile, + DefinitionStages.WithVmImage, + DefinitionStages.WithCreate { + } + /** The VirtualMachine definition stages. */ + interface DefinitionStages { + /** The first stage of the VirtualMachine definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VirtualMachine definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the VirtualMachine definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the VirtualMachine definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithAdminUsername withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the VirtualMachine definition allowing to specify adminUsername. */ + interface WithAdminUsername { + /** + * Specifies the adminUsername property: The name of the administrator to which the ssh public keys will be + * added into the authorized keys.. + * + * @param adminUsername The name of the administrator to which the ssh public keys will be added into the + * authorized keys. + * @return the next definition stage. + */ + WithCloudServicesNetworkAttachment withAdminUsername(String adminUsername); + } + /** The stage of the VirtualMachine definition allowing to specify cloudServicesNetworkAttachment. */ + interface WithCloudServicesNetworkAttachment { + /** + * Specifies the cloudServicesNetworkAttachment property: NetworkAttachment represents the single network + * attachment. + * + *

The cloud service network that provides platform-level services for the virtual machine.. + * + * @param cloudServicesNetworkAttachment NetworkAttachment represents the single network attachment. + *

The cloud service network that provides platform-level services for the virtual machine. + * @return the next definition stage. + */ + WithCpuCores withCloudServicesNetworkAttachment(NetworkAttachment cloudServicesNetworkAttachment); + } + /** The stage of the VirtualMachine definition allowing to specify cpuCores. */ + interface WithCpuCores { + /** + * Specifies the cpuCores property: The number of CPU cores in the virtual machine.. + * + * @param cpuCores The number of CPU cores in the virtual machine. + * @return the next definition stage. + */ + WithMemorySizeGB withCpuCores(long cpuCores); + } + /** The stage of the VirtualMachine definition allowing to specify memorySizeGB. */ + interface WithMemorySizeGB { + /** + * Specifies the memorySizeGB property: The memory size of the virtual machine in GB.. + * + * @param memorySizeGB The memory size of the virtual machine in GB. + * @return the next definition stage. + */ + WithStorageProfile withMemorySizeGB(long memorySizeGB); + } + /** The stage of the VirtualMachine definition allowing to specify storageProfile. */ + interface WithStorageProfile { + /** + * Specifies the storageProfile property: StorageProfile represents information about a disk. + * + *

The storage profile that specifies size and other parameters about the disks related to the virtual + * machine.. + * + * @param storageProfile StorageProfile represents information about a disk. + *

The storage profile that specifies size and other parameters about the disks related to the + * virtual machine. + * @return the next definition stage. + */ + WithVmImage withStorageProfile(StorageProfile storageProfile); + } + /** The stage of the VirtualMachine definition allowing to specify vmImage. */ + interface WithVmImage { + /** + * Specifies the vmImage property: The virtual machine image that is currently provisioned to the OS disk, + * using the full url and tag notation used to pull the image.. + * + * @param vmImage The virtual machine image that is currently provisioned to the OS disk, using the full url + * and tag notation used to pull the image. + * @return the next definition stage. + */ + WithCreate withVmImage(String vmImage); + } + /** + * The stage of the VirtualMachine 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.WithTags, + DefinitionStages.WithBootMethod, + DefinitionStages.WithIsolateEmulatorThread, + DefinitionStages.WithNetworkAttachments, + DefinitionStages.WithNetworkData, + DefinitionStages.WithPlacementHints, + DefinitionStages.WithSshPublicKeys, + DefinitionStages.WithUserData, + DefinitionStages.WithVirtioInterface, + DefinitionStages.WithVmDeviceModel, + DefinitionStages.WithVmImageRepositoryCredentials { + /** + * Executes the create request. + * + * @return the created resource. + */ + VirtualMachine create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VirtualMachine create(Context context); + } + /** The stage of the VirtualMachine definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the VirtualMachine definition allowing to specify bootMethod. */ + interface WithBootMethod { + /** + * Specifies the bootMethod property: Selects the boot method for the virtual machine.. + * + * @param bootMethod Selects the boot method for the virtual machine. + * @return the next definition stage. + */ + WithCreate withBootMethod(VirtualMachineBootMethod bootMethod); + } + /** The stage of the VirtualMachine definition allowing to specify isolateEmulatorThread. */ + interface WithIsolateEmulatorThread { + /** + * Specifies the isolateEmulatorThread property: Field Deprecated, the value will be ignored if provided. + * The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this + * virtual machine.. + * + * @param isolateEmulatorThread Field Deprecated, the value will be ignored if provided. The indicator of + * whether one of the specified CPU cores is isolated to run the emulator thread for this virtual + * machine. + * @return the next definition stage. + */ + WithCreate withIsolateEmulatorThread(VirtualMachineIsolateEmulatorThread isolateEmulatorThread); + } + /** The stage of the VirtualMachine definition allowing to specify networkAttachments. */ + interface WithNetworkAttachments { + /** + * Specifies the networkAttachments property: The list of network attachments to the virtual machine.. + * + * @param networkAttachments The list of network attachments to the virtual machine. + * @return the next definition stage. + */ + WithCreate withNetworkAttachments(List networkAttachments); + } + /** The stage of the VirtualMachine definition allowing to specify networkData. */ + interface WithNetworkData { + /** + * Specifies the networkData property: The Base64 encoded cloud-init network data.. + * + * @param networkData The Base64 encoded cloud-init network data. + * @return the next definition stage. + */ + WithCreate withNetworkData(String networkData); + } + /** The stage of the VirtualMachine definition allowing to specify placementHints. */ + interface WithPlacementHints { + /** + * Specifies the placementHints property: The scheduling hints for the virtual machine.. + * + * @param placementHints The scheduling hints for the virtual machine. + * @return the next definition stage. + */ + WithCreate withPlacementHints(List placementHints); + } + /** The stage of the VirtualMachine definition allowing to specify sshPublicKeys. */ + interface WithSshPublicKeys { + /** + * Specifies the sshPublicKeys property: The list of ssh public keys. Each key will be added to the virtual + * machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.. + * + * @param sshPublicKeys The list of ssh public keys. Each key will be added to the virtual machine using the + * cloud-init ssh_authorized_keys mechanism for the adminUsername. + * @return the next definition stage. + */ + WithCreate withSshPublicKeys(List sshPublicKeys); + } + /** The stage of the VirtualMachine definition allowing to specify userData. */ + interface WithUserData { + /** + * Specifies the userData property: The Base64 encoded cloud-init user data.. + * + * @param userData The Base64 encoded cloud-init user data. + * @return the next definition stage. + */ + WithCreate withUserData(String userData); + } + /** The stage of the VirtualMachine definition allowing to specify virtioInterface. */ + interface WithVirtioInterface { + /** + * Specifies the virtioInterface property: Field Deprecated, use virtualizationModel instead. The type of + * the virtio interface.. + * + * @param virtioInterface Field Deprecated, use virtualizationModel instead. The type of the virtio + * interface. + * @return the next definition stage. + */ + WithCreate withVirtioInterface(VirtualMachineVirtioInterfaceType virtioInterface); + } + /** The stage of the VirtualMachine definition allowing to specify vmDeviceModel. */ + interface WithVmDeviceModel { + /** + * Specifies the vmDeviceModel property: The type of the device model to use.. + * + * @param vmDeviceModel The type of the device model to use. + * @return the next definition stage. + */ + WithCreate withVmDeviceModel(VirtualMachineDeviceModelType vmDeviceModel); + } + /** The stage of the VirtualMachine definition allowing to specify vmImageRepositoryCredentials. */ + interface WithVmImageRepositoryCredentials { + /** + * Specifies the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the + * credentials used to login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image.. + * + * @param vmImageRepositoryCredentials ImageRepositoryCredentials represents the credentials used to login + * to the image repository. + *

The credentials used to login to the image repository that has access to the specified image. + * @return the next definition stage. + */ + WithCreate withVmImageRepositoryCredentials(ImageRepositoryCredentials vmImageRepositoryCredentials); + } + } + /** + * Begins update for the VirtualMachine resource. + * + * @return the stage of resource update. + */ + VirtualMachine.Update update(); + + /** The template for VirtualMachine update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithVmImageRepositoryCredentials { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VirtualMachine apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VirtualMachine apply(Context context); + } + /** The VirtualMachine update stages. */ + interface UpdateStages { + /** The stage of the VirtualMachine update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the VirtualMachine update allowing to specify vmImageRepositoryCredentials. */ + interface WithVmImageRepositoryCredentials { + /** + * Specifies the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the + * credentials used to login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image.. + * + * @param vmImageRepositoryCredentials ImageRepositoryCredentials represents the credentials used to login + * to the image repository. + *

The credentials used to login to the image repository that has access to the specified image. + * @return the next definition stage. + */ + Update withVmImageRepositoryCredentials(ImageRepositoryCredentials vmImageRepositoryCredentials); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VirtualMachine refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VirtualMachine refresh(Context context); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume(VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume(VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, Context context); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume(VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume(VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, Context context); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @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 powerOff(); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param virtualMachinePowerOffParameters The request body. + * @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 powerOff(VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, Context context); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @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 reimage(); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @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 reimage(Context context); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @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 restart(); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @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 restart(Context context); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @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 start(); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @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 start(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.java new file mode 100644 index 000000000000..384a79fa1098 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineBootMethod.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Selects the boot method for the virtual machine. */ +public final class VirtualMachineBootMethod extends ExpandableStringEnum { + /** Static value UEFI for VirtualMachineBootMethod. */ + public static final VirtualMachineBootMethod UEFI = fromString("UEFI"); + + /** Static value BIOS for VirtualMachineBootMethod. */ + public static final VirtualMachineBootMethod BIOS = fromString("BIOS"); + + /** + * Creates a new instance of VirtualMachineBootMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineBootMethod() { + } + + /** + * Creates or finds a VirtualMachineBootMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineBootMethod. + */ + @JsonCreator + public static VirtualMachineBootMethod fromString(String name) { + return fromString(name, VirtualMachineBootMethod.class); + } + + /** + * Gets known VirtualMachineBootMethod values. + * + * @return known VirtualMachineBootMethod values. + */ + public static Collection values() { + return values(VirtualMachineBootMethod.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java new file mode 100644 index 000000000000..425f76da3ff0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the virtual machine. */ +public final class VirtualMachineDetailedStatus extends ExpandableStringEnum { + /** Static value Error for VirtualMachineDetailedStatus. */ + public static final VirtualMachineDetailedStatus ERROR = fromString("Error"); + + /** Static value Available for VirtualMachineDetailedStatus. */ + public static final VirtualMachineDetailedStatus AVAILABLE = fromString("Available"); + + /** Static value Provisioning for VirtualMachineDetailedStatus. */ + public static final VirtualMachineDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of VirtualMachineDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineDetailedStatus() { + } + + /** + * Creates or finds a VirtualMachineDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineDetailedStatus. + */ + @JsonCreator + public static VirtualMachineDetailedStatus fromString(String name) { + return fromString(name, VirtualMachineDetailedStatus.class); + } + + /** + * Gets known VirtualMachineDetailedStatus values. + * + * @return known VirtualMachineDetailedStatus values. + */ + public static Collection values() { + return values(VirtualMachineDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.java new file mode 100644 index 000000000000..34d50057b2ec --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineDeviceModelType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the device model to use. */ +public final class VirtualMachineDeviceModelType extends ExpandableStringEnum { + /** Static value T1 for VirtualMachineDeviceModelType. */ + public static final VirtualMachineDeviceModelType T1 = fromString("T1"); + + /** Static value T2 for VirtualMachineDeviceModelType. */ + public static final VirtualMachineDeviceModelType T2 = fromString("T2"); + + /** + * Creates a new instance of VirtualMachineDeviceModelType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineDeviceModelType() { + } + + /** + * Creates or finds a VirtualMachineDeviceModelType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineDeviceModelType. + */ + @JsonCreator + public static VirtualMachineDeviceModelType fromString(String name) { + return fromString(name, VirtualMachineDeviceModelType.class); + } + + /** + * Gets known VirtualMachineDeviceModelType values. + * + * @return known VirtualMachineDeviceModelType values. + */ + public static Collection values() { + return values(VirtualMachineDeviceModelType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java new file mode 100644 index 000000000000..88a9a107883f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIpAllocationMethod.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also + * specify Disabled. Otherwise, Disabled is the only permitted value. + */ +public final class VirtualMachineIpAllocationMethod extends ExpandableStringEnum { + /** Static value Dynamic for VirtualMachineIpAllocationMethod. */ + public static final VirtualMachineIpAllocationMethod DYNAMIC = fromString("Dynamic"); + + /** Static value Static for VirtualMachineIpAllocationMethod. */ + public static final VirtualMachineIpAllocationMethod STATIC = fromString("Static"); + + /** Static value Disabled for VirtualMachineIpAllocationMethod. */ + public static final VirtualMachineIpAllocationMethod DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of VirtualMachineIpAllocationMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineIpAllocationMethod() { + } + + /** + * Creates or finds a VirtualMachineIpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineIpAllocationMethod. + */ + @JsonCreator + public static VirtualMachineIpAllocationMethod fromString(String name) { + return fromString(name, VirtualMachineIpAllocationMethod.class); + } + + /** + * Gets known VirtualMachineIpAllocationMethod values. + * + * @return known VirtualMachineIpAllocationMethod values. + */ + public static Collection values() { + return values(VirtualMachineIpAllocationMethod.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java new file mode 100644 index 000000000000..d82a983dfc49 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineIsolateEmulatorThread.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is + * isolated to run the emulator thread for this virtual machine. + */ +public final class VirtualMachineIsolateEmulatorThread + extends ExpandableStringEnum { + /** Static value True for VirtualMachineIsolateEmulatorThread. */ + public static final VirtualMachineIsolateEmulatorThread TRUE = fromString("True"); + + /** Static value False for VirtualMachineIsolateEmulatorThread. */ + public static final VirtualMachineIsolateEmulatorThread FALSE = fromString("False"); + + /** + * Creates a new instance of VirtualMachineIsolateEmulatorThread value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineIsolateEmulatorThread() { + } + + /** + * Creates or finds a VirtualMachineIsolateEmulatorThread from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineIsolateEmulatorThread. + */ + @JsonCreator + public static VirtualMachineIsolateEmulatorThread fromString(String name) { + return fromString(name, VirtualMachineIsolateEmulatorThread.class); + } + + /** + * Gets known VirtualMachineIsolateEmulatorThread values. + * + * @return known VirtualMachineIsolateEmulatorThread values. + */ + public static Collection values() { + return values(VirtualMachineIsolateEmulatorThread.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java new file mode 100644 index 000000000000..60a185ed8316 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachineInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VirtualMachineList represents a list of virtual machines. */ +@Fluent +public final class VirtualMachineList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of virtual machines. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of VirtualMachineList class. */ + public VirtualMachineList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineList object itself. + */ + public VirtualMachineList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of virtual machines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of virtual machines. + * + * @param value the value value to set. + * @return the VirtualMachineList object itself. + */ + public VirtualMachineList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java new file mode 100644 index 000000000000..bcd9b7ccd1b2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePatchParameters.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.VirtualMachinePatchProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. */ +@Fluent +public final class VirtualMachinePatchParameters { + /* + * VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + * + * The list of the resource properties. + */ + @JsonProperty(value = "properties") + private VirtualMachinePatchProperties innerProperties; + + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of VirtualMachinePatchParameters class. */ + public VirtualMachinePatchParameters() { + } + + /** + * Get the innerProperties property: VirtualMachinePatchProperties represents the properties of the virtual machine + * that can be patched. + * + *

The list of the resource properties. + * + * @return the innerProperties value. + */ + private VirtualMachinePatchProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the VirtualMachinePatchParameters object itself. + */ + public VirtualMachinePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @return the vmImageRepositoryCredentials value. + */ + public ImageRepositoryCredentials vmImageRepositoryCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().vmImageRepositoryCredentials(); + } + + /** + * Set the vmImageRepositoryCredentials property: ImageRepositoryCredentials represents the credentials used to + * login to the image repository. + * + *

The credentials used to login to the image repository that has access to the specified image. + * + * @param vmImageRepositoryCredentials the vmImageRepositoryCredentials value to set. + * @return the VirtualMachinePatchParameters object itself. + */ + public VirtualMachinePatchParameters withVmImageRepositoryCredentials( + ImageRepositoryCredentials vmImageRepositoryCredentials) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualMachinePatchProperties(); + } + this.innerProperties().withVmImageRepositoryCredentials(vmImageRepositoryCredentials); + 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/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java new file mode 100644 index 000000000000..c9a37809dce4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHint.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. */ +@Fluent +public final class VirtualMachinePlacementHint { + /* + * The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + */ + @JsonProperty(value = "hintType", required = true) + private VirtualMachinePlacementHintType hintType; + + /* + * The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node + * to host the virtual machine. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * The indicator of whether the hint is a hard or soft requirement during scheduling. + */ + @JsonProperty(value = "schedulingExecution", required = true) + private VirtualMachineSchedulingExecution schedulingExecution; + + /* + * The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the + * case of node affinity. + */ + @JsonProperty(value = "scope", required = true) + private VirtualMachinePlacementHintPodAffinityScope scope; + + /** Creates an instance of VirtualMachinePlacementHint class. */ + public VirtualMachinePlacementHint() { + } + + /** + * Get the hintType property: The specification of whether this hint supports affinity or anti-affinity with the + * referenced resources. + * + * @return the hintType value. + */ + public VirtualMachinePlacementHintType hintType() { + return this.hintType; + } + + /** + * Set the hintType property: The specification of whether this hint supports affinity or anti-affinity with the + * referenced resources. + * + * @param hintType the hintType value to set. + * @return the VirtualMachinePlacementHint object itself. + */ + public VirtualMachinePlacementHint withHintType(VirtualMachinePlacementHintType hintType) { + this.hintType = hintType; + return this; + } + + /** + * Get the resourceId property: The resource ID of the target object that the placement hints will be checked + * against, e.g., the bare metal node to host the virtual machine. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of the target object that the placement hints will be checked + * against, e.g., the bare metal node to host the virtual machine. + * + * @param resourceId the resourceId value to set. + * @return the VirtualMachinePlacementHint object itself. + */ + public VirtualMachinePlacementHint withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the schedulingExecution property: The indicator of whether the hint is a hard or soft requirement during + * scheduling. + * + * @return the schedulingExecution value. + */ + public VirtualMachineSchedulingExecution schedulingExecution() { + return this.schedulingExecution; + } + + /** + * Set the schedulingExecution property: The indicator of whether the hint is a hard or soft requirement during + * scheduling. + * + * @param schedulingExecution the schedulingExecution value to set. + * @return the VirtualMachinePlacementHint object itself. + */ + public VirtualMachinePlacementHint withSchedulingExecution(VirtualMachineSchedulingExecution schedulingExecution) { + this.schedulingExecution = schedulingExecution; + return this; + } + + /** + * Get the scope property: The scope for the virtual machine affinity or anti-affinity placement hint. It should + * always be "Machine" in the case of node affinity. + * + * @return the scope value. + */ + public VirtualMachinePlacementHintPodAffinityScope scope() { + return this.scope; + } + + /** + * Set the scope property: The scope for the virtual machine affinity or anti-affinity placement hint. It should + * always be "Machine" in the case of node affinity. + * + * @param scope the scope value to set. + * @return the VirtualMachinePlacementHint object itself. + */ + public VirtualMachinePlacementHint withScope(VirtualMachinePlacementHintPodAffinityScope scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hintType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property hintType in model VirtualMachinePlacementHint")); + } + if (resourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceId in model VirtualMachinePlacementHint")); + } + if (schedulingExecution() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schedulingExecution in model VirtualMachinePlacementHint")); + } + if (scope() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property scope in model VirtualMachinePlacementHint")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinePlacementHint.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java new file mode 100644 index 000000000000..23b690ba4169 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintPodAffinityScope.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case + * of node affinity. + */ +public final class VirtualMachinePlacementHintPodAffinityScope + extends ExpandableStringEnum { + /** Static value Rack for VirtualMachinePlacementHintPodAffinityScope. */ + public static final VirtualMachinePlacementHintPodAffinityScope RACK = fromString("Rack"); + + /** Static value Machine for VirtualMachinePlacementHintPodAffinityScope. */ + public static final VirtualMachinePlacementHintPodAffinityScope MACHINE = fromString("Machine"); + + /** + * Creates a new instance of VirtualMachinePlacementHintPodAffinityScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachinePlacementHintPodAffinityScope() { + } + + /** + * Creates or finds a VirtualMachinePlacementHintPodAffinityScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachinePlacementHintPodAffinityScope. + */ + @JsonCreator + public static VirtualMachinePlacementHintPodAffinityScope fromString(String name) { + return fromString(name, VirtualMachinePlacementHintPodAffinityScope.class); + } + + /** + * Gets known VirtualMachinePlacementHintPodAffinityScope values. + * + * @return known VirtualMachinePlacementHintPodAffinityScope values. + */ + public static Collection values() { + return values(VirtualMachinePlacementHintPodAffinityScope.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.java new file mode 100644 index 000000000000..76c05662e1b9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePlacementHintType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The specification of whether this hint supports affinity or anti-affinity with the referenced resources. */ +public final class VirtualMachinePlacementHintType extends ExpandableStringEnum { + /** Static value Affinity for VirtualMachinePlacementHintType. */ + public static final VirtualMachinePlacementHintType AFFINITY = fromString("Affinity"); + + /** Static value AntiAffinity for VirtualMachinePlacementHintType. */ + public static final VirtualMachinePlacementHintType ANTI_AFFINITY = fromString("AntiAffinity"); + + /** + * Creates a new instance of VirtualMachinePlacementHintType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachinePlacementHintType() { + } + + /** + * Creates or finds a VirtualMachinePlacementHintType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachinePlacementHintType. + */ + @JsonCreator + public static VirtualMachinePlacementHintType fromString(String name) { + return fromString(name, VirtualMachinePlacementHintType.class); + } + + /** + * Gets known VirtualMachinePlacementHintType values. + * + * @return known VirtualMachinePlacementHintType values. + */ + public static Collection values() { + return values(VirtualMachinePlacementHintType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java new file mode 100644 index 000000000000..87a1f65ba746 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerOffParameters.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. */ +@Fluent +public final class VirtualMachinePowerOffParameters { + /* + * The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. + */ + @JsonProperty(value = "skipShutdown") + private SkipShutdown skipShutdown; + + /** Creates an instance of VirtualMachinePowerOffParameters class. */ + public VirtualMachinePowerOffParameters() { + } + + /** + * Get the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the + * virtual machine immediately. + * + * @return the skipShutdown value. + */ + public SkipShutdown skipShutdown() { + return this.skipShutdown; + } + + /** + * Set the skipShutdown property: The indicator of whether to skip the graceful OS shutdown and power off the + * virtual machine immediately. + * + * @param skipShutdown the skipShutdown value to set. + * @return the VirtualMachinePowerOffParameters object itself. + */ + public VirtualMachinePowerOffParameters withSkipShutdown(SkipShutdown skipShutdown) { + this.skipShutdown = skipShutdown; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.java new file mode 100644 index 000000000000..c868dbe63447 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachinePowerState.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The power state of the virtual machine. */ +public final class VirtualMachinePowerState extends ExpandableStringEnum { + /** Static value On for VirtualMachinePowerState. */ + public static final VirtualMachinePowerState ON = fromString("On"); + + /** Static value Off for VirtualMachinePowerState. */ + public static final VirtualMachinePowerState OFF = fromString("Off"); + + /** + * Creates a new instance of VirtualMachinePowerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachinePowerState() { + } + + /** + * Creates or finds a VirtualMachinePowerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachinePowerState. + */ + @JsonCreator + public static VirtualMachinePowerState fromString(String name) { + return fromString(name, VirtualMachinePowerState.class); + } + + /** + * Gets known VirtualMachinePowerState values. + * + * @return known VirtualMachinePowerState values. + */ + public static Collection values() { + return values(VirtualMachinePowerState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java new file mode 100644 index 000000000000..a9be8f4c227d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the virtual machine. */ +public final class VirtualMachineProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for VirtualMachineProvisioningState. */ + public static final VirtualMachineProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for VirtualMachineProvisioningState. */ + public static final VirtualMachineProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for VirtualMachineProvisioningState. */ + public static final VirtualMachineProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for VirtualMachineProvisioningState. */ + public static final VirtualMachineProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for VirtualMachineProvisioningState. */ + public static final VirtualMachineProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of VirtualMachineProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineProvisioningState() { + } + + /** + * Creates or finds a VirtualMachineProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineProvisioningState. + */ + @JsonCreator + public static VirtualMachineProvisioningState fromString(String name) { + return fromString(name, VirtualMachineProvisioningState.class); + } + + /** + * Gets known VirtualMachineProvisioningState values. + * + * @return known VirtualMachineProvisioningState values. + */ + public static Collection values() { + return values(VirtualMachineProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.java new file mode 100644 index 000000000000..3ecb70822fed --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineSchedulingExecution.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the hint is a hard or soft requirement during scheduling. */ +public final class VirtualMachineSchedulingExecution extends ExpandableStringEnum { + /** Static value Hard for VirtualMachineSchedulingExecution. */ + public static final VirtualMachineSchedulingExecution HARD = fromString("Hard"); + + /** Static value Soft for VirtualMachineSchedulingExecution. */ + public static final VirtualMachineSchedulingExecution SOFT = fromString("Soft"); + + /** + * Creates a new instance of VirtualMachineSchedulingExecution value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineSchedulingExecution() { + } + + /** + * Creates or finds a VirtualMachineSchedulingExecution from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineSchedulingExecution. + */ + @JsonCreator + public static VirtualMachineSchedulingExecution fromString(String name) { + return fromString(name, VirtualMachineSchedulingExecution.class); + } + + /** + * Gets known VirtualMachineSchedulingExecution values. + * + * @return known VirtualMachineSchedulingExecution values. + */ + public static Collection values() { + return values(VirtualMachineSchedulingExecution.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.java new file mode 100644 index 000000000000..3f92db712bb8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVirtioInterfaceType.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Field Deprecated, use virtualizationModel instead. The type of the virtio interface. */ +public final class VirtualMachineVirtioInterfaceType extends ExpandableStringEnum { + /** Static value Modern for VirtualMachineVirtioInterfaceType. */ + public static final VirtualMachineVirtioInterfaceType MODERN = fromString("Modern"); + + /** Static value Transitional for VirtualMachineVirtioInterfaceType. */ + public static final VirtualMachineVirtioInterfaceType TRANSITIONAL = fromString("Transitional"); + + /** + * Creates a new instance of VirtualMachineVirtioInterfaceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualMachineVirtioInterfaceType() { + } + + /** + * Creates or finds a VirtualMachineVirtioInterfaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualMachineVirtioInterfaceType. + */ + @JsonCreator + public static VirtualMachineVirtioInterfaceType fromString(String name) { + return fromString(name, VirtualMachineVirtioInterfaceType.class); + } + + /** + * Gets known VirtualMachineVirtioInterfaceType values. + * + * @return known VirtualMachineVirtioInterfaceType values. + */ + public static Collection values() { + return values(VirtualMachineVirtioInterfaceType.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVolumeParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVolumeParameters.java new file mode 100644 index 000000000000..41b81663fc4f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachineVolumeParameters.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * VirtualMachineVolumeParameters represents the body of the request to handle attachment and detachment of volumes for + * the virtual machine. + */ +@Fluent +public final class VirtualMachineVolumeParameters { + /* + * The resource ID of the volume. + */ + @JsonProperty(value = "volumeId", required = true) + private String volumeId; + + /** Creates an instance of VirtualMachineVolumeParameters class. */ + public VirtualMachineVolumeParameters() { + } + + /** + * Get the volumeId property: The resource ID of the volume. + * + * @return the volumeId value. + */ + public String volumeId() { + return this.volumeId; + } + + /** + * Set the volumeId property: The resource ID of the volume. + * + * @param volumeId the volumeId value to set. + * @return the VirtualMachineVolumeParameters object itself. + */ + public VirtualMachineVolumeParameters withVolumeId(String volumeId) { + this.volumeId = volumeId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property volumeId in model VirtualMachineVolumeParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineVolumeParameters.class); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java new file mode 100644 index 000000000000..f7a53283de8f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VirtualMachines.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of VirtualMachines. */ +public interface VirtualMachines { + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List virtual machines in the subscription. + * + *

Get a list of virtual machines in the provided subscription. + * + * @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 a list of virtual machines in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of virtual machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List virtual machines in the resource group. + * + *

Get a list of virtual machines in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of virtual machines in the provided resource group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String virtualMachineName, Context context); + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 properties of the provided virtual machine. + */ + VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 deleteByResourceGroup(String resourceGroupName, String virtualMachineName); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 delete(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters); + + /** + * Attach volume to the virtual machine. + * + *

Attach volume to the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineAttachVolumeParameters The request body. + * @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 attachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineAttachVolumeParameters, + Context context); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters); + + /** + * Detach volume from the virtual machine. + * + *

Detach volume from the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachineDetachVolumeParameters The request body. + * @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 detachVolume( + String resourceGroupName, + String virtualMachineName, + VirtualMachineVolumeParameters virtualMachineDetachVolumeParameters, + Context context); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 powerOff(String resourceGroupName, String virtualMachineName); + + /** + * Power off the virtual machine. + * + *

Power off the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @param virtualMachinePowerOffParameters The request body. + * @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 powerOff( + String resourceGroupName, + String virtualMachineName, + VirtualMachinePowerOffParameters virtualMachinePowerOffParameters, + Context context); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimage(String resourceGroupName, String virtualMachineName); + + /** + * Reimage the virtual machine. + * + *

Reimage the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 reimage(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restart(String resourceGroupName, String virtualMachineName); + + /** + * Restart the virtual machine. + * + *

Restart the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 restart(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 start(String resourceGroupName, String virtualMachineName); + + /** + * Start the virtual machine. + * + *

Start the provided virtual machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineName The name of the virtual machine. + * @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 start(String resourceGroupName, String virtualMachineName, Context context); + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param id the resource ID. + * @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 properties of the provided virtual machine along with {@link Response}. + */ + VirtualMachine getById(String id); + + /** + * Retrieve the virtual machine. + * + *

Get properties of the provided virtual machine. + * + * @param id the resource ID. + * @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 properties of the provided virtual machine along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the virtual machine. + * + *

Delete the provided virtual machine. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new VirtualMachine resource. + * + * @param name resource name. + * @return the first stage of the new VirtualMachine definition. + */ + VirtualMachine.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java new file mode 100644 index 000000000000..fc0ae5fae599 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volume.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Volume. */ +public interface Volume { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the extendedLocation property: ExtendedLocation represents the Azure custom location where the resource will + * be created. + * + *

The extended location of the cluster associated with the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the attachedTo property: The list of resource IDs that attach the volume. It may include virtual machines + * and Hybrid AKS clusters. + * + * @return the attachedTo value. + */ + List attachedTo(); + + /** + * Gets the detailedStatus property: The more detailed status of the volume. + * + * @return the detailedStatus value. + */ + VolumeDetailedStatus detailedStatus(); + + /** + * Gets the detailedStatusMessage property: The descriptive message about the current detailed status. + * + * @return the detailedStatusMessage value. + */ + String detailedStatusMessage(); + + /** + * Gets the provisioningState property: The provisioning state of the volume. + * + * @return the provisioningState value. + */ + VolumeProvisioningState provisioningState(); + + /** + * Gets the serialNumber property: The unique identifier of the volume. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the sizeMiB property: The size of the allocation for this volume in Mebibytes. + * + * @return the sizeMiB value. + */ + long sizeMiB(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner object. + * + * @return the inner object. + */ + VolumeInner innerModel(); + + /** The entirety of the Volume definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithExtendedLocation, + DefinitionStages.WithSizeMiB, + DefinitionStages.WithCreate { + } + /** The Volume definition stages. */ + interface DefinitionStages { + /** The first stage of the Volume definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Volume definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Volume definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Volume definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: ExtendedLocation represents the Azure custom location where the + * resource will be created. + * + *

The extended location of the cluster associated with the resource.. + * + * @param extendedLocation ExtendedLocation represents the Azure custom location where the resource will be + * created. + *

The extended location of the cluster associated with the resource. + * @return the next definition stage. + */ + WithSizeMiB withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the Volume definition allowing to specify sizeMiB. */ + interface WithSizeMiB { + /** + * Specifies the sizeMiB property: The size of the allocation for this volume in Mebibytes.. + * + * @param sizeMiB The size of the allocation for this volume in Mebibytes. + * @return the next definition stage. + */ + WithCreate withSizeMiB(long sizeMiB); + } + /** + * The stage of the Volume 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.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + Volume create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Volume create(Context context); + } + /** The stage of the Volume definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the Volume resource. + * + * @return the stage of resource update. + */ + Volume.Update update(); + + /** The template for Volume update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Volume apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Volume apply(Context context); + } + /** The Volume update stages. */ + interface UpdateStages { + /** The stage of the Volume update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The Azure resource tags that will replace the existing ones.. + * + * @param tags The Azure resource tags that will replace the existing ones. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Volume refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Volume refresh(Context context); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java new file mode 100644 index 000000000000..857afd94c80b --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeDetailedStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The more detailed status of the volume. */ +public final class VolumeDetailedStatus extends ExpandableStringEnum { + /** Static value Error for VolumeDetailedStatus. */ + public static final VolumeDetailedStatus ERROR = fromString("Error"); + + /** Static value Active for VolumeDetailedStatus. */ + public static final VolumeDetailedStatus ACTIVE = fromString("Active"); + + /** Static value Provisioning for VolumeDetailedStatus. */ + public static final VolumeDetailedStatus PROVISIONING = fromString("Provisioning"); + + /** + * Creates a new instance of VolumeDetailedStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeDetailedStatus() { + } + + /** + * Creates or finds a VolumeDetailedStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VolumeDetailedStatus. + */ + @JsonCreator + public static VolumeDetailedStatus fromString(String name) { + return fromString(name, VolumeDetailedStatus.class); + } + + /** + * Gets known VolumeDetailedStatus values. + * + * @return known VolumeDetailedStatus values. + */ + public static Collection values() { + return values(VolumeDetailedStatus.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java new file mode 100644 index 000000000000..ff042a9fba5f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.networkcloud.fluent.models.VolumeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** VolumeList represents a list of volumes. */ +@Fluent +public final class VolumeList { + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of volumes. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of VolumeList class. */ + public VolumeList() { + } + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the VolumeList object itself. + */ + public VolumeList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of volumes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of volumes. + * + * @param value the value value to set. + * @return the VolumeList object itself. + */ + public VolumeList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java new file mode 100644 index 000000000000..4e311be841ec --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumePatchParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** VolumePatchParameters represents the body of the request to patch the volume resource. */ +@Fluent +public final class VolumePatchParameters { + /* + * The Azure resource tags that will replace the existing ones. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of VolumePatchParameters class. */ + public VolumePatchParameters() { + } + + /** + * Get the tags property: The Azure resource tags that will replace the existing ones. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The Azure resource tags that will replace the existing ones. + * + * @param tags the tags value to set. + * @return the VolumePatchParameters object itself. + */ + public VolumePatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java new file mode 100644 index 000000000000..e462273d3593 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/VolumeProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the volume. */ +public final class VolumeProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for VolumeProvisioningState. */ + public static final VolumeProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for VolumeProvisioningState. */ + public static final VolumeProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for VolumeProvisioningState. */ + public static final VolumeProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Provisioning for VolumeProvisioningState. */ + public static final VolumeProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Accepted for VolumeProvisioningState. */ + public static final VolumeProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of VolumeProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeProvisioningState() { + } + + /** + * Creates or finds a VolumeProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VolumeProvisioningState. + */ + @JsonCreator + public static VolumeProvisioningState fromString(String name) { + return fromString(name, VolumeProvisioningState.class); + } + + /** + * Gets known VolumeProvisioningState values. + * + * @return known VolumeProvisioningState values. + */ + public static Collection values() { + return values(VolumeProvisioningState.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java new file mode 100644 index 000000000000..550280df3701 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/Volumes.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Volumes. */ +public interface Volumes { + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List volumes in the subscription. + * + *

Get a list of volumes in the provided subscription. + * + * @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 a list of volumes in the provided subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of volumes in the provided resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List volumes in the resource group. + * + *

Get a list of volumes in the provided resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 a list of volumes in the provided resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String volumeName, Context context); + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 properties of the provided volume. + */ + Volume getByResourceGroup(String resourceGroupName, String volumeName); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 deleteByResourceGroup(String resourceGroupName, String volumeName); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param volumeName The name of the volume. + * @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 delete(String resourceGroupName, String volumeName, Context context); + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param id the resource ID. + * @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 properties of the provided volume along with {@link Response}. + */ + Volume getById(String id); + + /** + * Retrieve the volume. + * + *

Get properties of the provided volume. + * + * @param id the resource ID. + * @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 properties of the provided volume along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param id the resource ID. + * @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 deleteById(String id); + + /** + * Delete the volume. + * + *

Delete the provided volume. + * + * @param id the resource ID. + * @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 deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Volume resource. + * + * @param name resource name. + * @return the first stage of the new Volume definition. + */ + Volume.DefinitionStages.Blank define(String name); +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.java new file mode 100644 index 000000000000..807acb84eea6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/WorkloadImpact.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.networkcloud.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The indicator of whether the workload will be impacted during the upgrade. */ +public final class WorkloadImpact extends ExpandableStringEnum { + /** Static value True for WorkloadImpact. */ + public static final WorkloadImpact TRUE = fromString("True"); + + /** Static value False for WorkloadImpact. */ + public static final WorkloadImpact FALSE = fromString("False"); + + /** + * Creates a new instance of WorkloadImpact value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkloadImpact() { + } + + /** + * Creates or finds a WorkloadImpact from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadImpact. + */ + @JsonCreator + public static WorkloadImpact fromString(String name) { + return fromString(name, WorkloadImpact.class); + } + + /** + * Gets known WorkloadImpact values. + * + * @return known WorkloadImpact values. + */ + public static Collection values() { + return values(WorkloadImpact.class); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java new file mode 100644 index 000000000000..cb4ca688c84d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for NetworkCloud. The Network Cloud APIs provide management of the on-premises + * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + */ +package com.azure.resourcemanager.networkcloud.models; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java new file mode 100644 index 000000000000..c21b9b57fcf6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/com/azure/resourcemanager/networkcloud/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for NetworkCloud. The Network Cloud APIs provide management of the on-premises + * clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. + */ +package com.azure.resourcemanager.networkcloud; diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java new file mode 100644 index 000000000000..94acdf593d43 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.networkcloud { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.networkcloud; + exports com.azure.resourcemanager.networkcloud.fluent; + exports com.azure.resourcemanager.networkcloud.fluent.models; + exports com.azure.resourcemanager.networkcloud.models; + + opens com.azure.resourcemanager.networkcloud.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.networkcloud.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b3f49ce2a46d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsCreateOrUpdateSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachineKeySets CreateOrUpdate. */ +public final class BareMetalMachineKeySetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Create.json + */ + /** + * Sample code: Create or update bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .define("bareMetalMachineKeySetName") + .withRegion("location") + .withExistingCluster("resourceGroupName", "clusterName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) + .withPrivilegeLevel(BareMetalMachineKeySetPrivilegeLevel.STANDARD) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withOsGroupName("standardAccessGroup") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java new file mode 100644 index 000000000000..24ea840dacd8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BareMetalMachineKeySets Delete. */ +public final class BareMetalMachineKeySetsDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Delete.json + */ + /** + * Sample code: Delete bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .delete("resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java new file mode 100644 index 000000000000..9b7e7696576e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BareMetalMachineKeySets Get. */ +public final class BareMetalMachineKeySetsGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Get.json + */ + /** + * Sample code: Get bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .getWithResponse( + "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..b9fba9a45711 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BareMetalMachineKeySets ListByResourceGroup. */ +public final class BareMetalMachineKeySetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_ListByResourceGroup.json + */ + /** + * Sample code: List bare metal machine key set of cluster for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBareMetalMachineKeySetOfClusterForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachineKeySets() + .listByResourceGroup("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java new file mode 100644 index 000000000000..ad6d846f0361 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachineKeySetsUpdateSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineKeySet; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachineKeySets Update. */ +public final class BareMetalMachineKeySetsUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachineKeySets_Patch.json + */ + /** + * Sample code: Patch bare metal machine key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchBareMetalMachineKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BareMetalMachineKeySet resource = + manager + .bareMetalMachineKeySets() + .getWithResponse( + "resourceGroupName", "clusterName", "bareMetalMachineKeySetName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withJumpHostsAllowed(Arrays.asList("192.0.2.1", "192.0.2.5")) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java new file mode 100644 index 000000000000..f3195b40c635 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCordonSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCordonParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineEvacuate; + +/** Samples for BareMetalMachines Cordon. */ +public final class BareMetalMachinesCordonSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Cordon.json + */ + /** + * Sample code: Cordon bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void cordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .cordon( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineCordonParameters().withEvacuate(BareMetalMachineEvacuate.TRUE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0a15117dd7b1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesCreateOrUpdateSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachines CreateOrUpdate. */ +public final class BareMetalMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Create.json + */ + /** + * Sample code: Create or update bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .define("bareMetalMachineName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withBmcConnectionString("bmcconnectionstring") + .withBmcCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) + .withBmcMacAddress("00:00:4f:00:57:00") + .withBootMacAddress("00:00:4e:00:58:af") + .withMachineDetails("User-provided machine details.") + .withMachineName("r01c001") + .withMachineSkuId("684E-3B16-399E") + .withRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.java new file mode 100644 index 000000000000..0b92d2b83eda --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesDeleteSamples.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.networkcloud.generated; + +/** Samples for BareMetalMachines Delete. */ +public final class BareMetalMachinesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Delete.json + */ + /** + * Sample code: Delete bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .delete("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4904359b55b4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BareMetalMachines GetByResourceGroup. */ +public final class BareMetalMachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Get.json + */ + /** + * Sample code: Get bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java new file mode 100644 index 000000000000..53661f1b5903 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BareMetalMachines ListByResourceGroup. */ +public final class BareMetalMachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListByResourceGroup.json + */ + /** + * Sample code: List bare metal machines for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBareMetalMachinesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java new file mode 100644 index 000000000000..e4170e9b69fd --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BareMetalMachines List. */ +public final class BareMetalMachinesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ListBySubscription.json + */ + /** + * Sample code: List bare metal machines for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBareMetalMachinesForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bareMetalMachines().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java new file mode 100644 index 000000000000..4bf7cbd040ad --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesPowerOffSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachinePowerOffParameters; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineSkipShutdown; + +/** Samples for BareMetalMachines PowerOff. */ +public final class BareMetalMachinesPowerOffSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_PowerOff.json + */ + /** + * Sample code: Power off bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void powerOffBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .powerOff( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachinePowerOffParameters().withSkipShutdown(BareMetalMachineSkipShutdown.TRUE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.java new file mode 100644 index 000000000000..8e2035b627a8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReimageSamples.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.networkcloud.generated; + +/** Samples for BareMetalMachines Reimage. */ +public final class BareMetalMachinesReimageSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Reimage.json + */ + /** + * Sample code: Reimage bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void reimageBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .reimage("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.java new file mode 100644 index 000000000000..e36f33dbae79 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesReplaceSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineReplaceParameters; + +/** Samples for BareMetalMachines Replace. */ +public final class BareMetalMachinesReplaceSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Replace.json + */ + /** + * Sample code: Replace bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void replaceBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .replace( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineReplaceParameters() + .withBmcCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("bmcuser")) + .withBmcMacAddress("00:00:4f:00:57:ad") + .withBootMacAddress("00:00:4e:00:58:af") + .withMachineName("name") + .withSerialNumber("BM1219XXX"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.java new file mode 100644 index 000000000000..eea9078364e4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRestartSamples.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.networkcloud.generated; + +/** Samples for BareMetalMachines Restart. */ +public final class BareMetalMachinesRestartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Restart.json + */ + /** + * Sample code: Restart bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void restartBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .restart("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.java new file mode 100644 index 000000000000..96e9d1fbf334 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunCommandSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunCommandParameters; +import java.util.Arrays; + +/** Samples for BareMetalMachines RunCommand. */ +public final class BareMetalMachinesRunCommandSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunCommand.json + */ + /** + * Sample code: Run command on bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runCommandOnBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .runCommand( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineRunCommandParameters() + .withArguments(Arrays.asList("--argument1", "argument2")) + .withLimitTimeSeconds(60L) + .withScript("cHdkCg=="), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.java new file mode 100644 index 000000000000..41a370e80305 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunDataExtractsSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters; +import java.util.Arrays; + +/** Samples for BareMetalMachines RunDataExtracts. */ +public final class BareMetalMachinesRunDataExtractsSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunDataExtracts.json + */ + /** + * Sample code: Run data extraction on bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runDataExtractionOnBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .runDataExtracts( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineRunDataExtractsParameters() + .withCommands(Arrays.asList(new BareMetalMachineCommandSpecification().withCommand("networkInfo"))) + .withLimitTimeSeconds(60L), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java new file mode 100644 index 000000000000..9a16ce093031 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesRunReadCommandsSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunReadCommandsParameters; +import java.util.Arrays; + +/** Samples for BareMetalMachines RunReadCommands. */ +public final class BareMetalMachinesRunReadCommandsSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_RunReadCommands.json + */ + /** + * Sample code: Run and retrieve output from read only commands on bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runAndRetrieveOutputFromReadOnlyCommandsOnBareMetalMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .runReadCommands( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineRunReadCommandsParameters() + .withCommands( + Arrays + .asList( + new BareMetalMachineCommandSpecification() + .withArguments(Arrays.asList("pods", "-A")) + .withCommand("kubectl get"), + new BareMetalMachineCommandSpecification() + .withArguments(Arrays.asList("192.168.0.99", "-c", "3")) + .withCommand("ping"))) + .withLimitTimeSeconds(60L), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.java new file mode 100644 index 000000000000..f4575d4f3685 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesStartSamples.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.networkcloud.generated; + +/** Samples for BareMetalMachines Start. */ +public final class BareMetalMachinesStartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Start.json + */ + /** + * Sample code: Start bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void startBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .start("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.java new file mode 100644 index 000000000000..ef79f3948afb --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUncordonSamples.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.networkcloud.generated; + +/** Samples for BareMetalMachines Uncordon. */ +public final class BareMetalMachinesUncordonSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Uncordon.json + */ + /** + * Sample code: Uncordon bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void uncordonBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .uncordon("resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.java new file mode 100644 index 000000000000..cdbab9407a3e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachine; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BareMetalMachines Update. */ +public final class BareMetalMachinesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_Patch.json + */ + /** + * Sample code: Patch bare metal machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchBareMetalMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BareMetalMachine resource = + manager + .bareMetalMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "bareMetalMachineName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withMachineDetails("machinedetails") + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesValidateHardwareSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesValidateHardwareSamples.java new file mode 100644 index 000000000000..f6c9a4f7343c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BareMetalMachinesValidateHardwareSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineHardwareValidationCategory; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineValidateHardwareParameters; + +/** Samples for BareMetalMachines ValidateHardware. */ +public final class BareMetalMachinesValidateHardwareSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BareMetalMachines_ValidateHardware.json + */ + /** + * Sample code: Validate the bare metal machine hardware. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void validateTheBareMetalMachineHardware( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bareMetalMachines() + .validateHardware( + "resourceGroupName", + "bareMetalMachineName", + new BareMetalMachineValidateHardwareParameters() + .withValidationCategory(BareMetalMachineHardwareValidationCategory.BASIC_VALIDATION), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b7d48f60bf57 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsCreateOrUpdateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BmcKeySetPrivilegeLevel; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BmcKeySets CreateOrUpdate. */ +public final class BmcKeySetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Create.json + */ + /** + * Sample code: Create or update baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bmcKeySets() + .define("bmcKeySetName") + .withRegion("location") + .withExistingCluster("resourceGroupName", "clusterName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAzureGroupId("f110271b-XXXX-4163-9b99-214d91660f0e") + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withPrivilegeLevel(BmcKeySetPrivilegeLevel.ADMINISTRATOR) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java new file mode 100644 index 000000000000..0342fff420f3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BmcKeySets Delete. */ +public final class BmcKeySetsDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Delete.json + */ + /** + * Sample code: Delete baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bmcKeySets() + .delete("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java new file mode 100644 index 000000000000..27664e16644e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BmcKeySets Get. */ +public final class BmcKeySetsGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Get.json + */ + /** + * Sample code: Get baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .bmcKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..0a4d1fb37058 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for BmcKeySets ListByResourceGroup. */ +public final class BmcKeySetsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_ListByResourceGroup.json + */ + /** + * Sample code: List baseboard management controller key set of cluster for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listBaseboardManagementControllerKeySetOfClusterForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.bmcKeySets().listByResourceGroup("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java new file mode 100644 index 000000000000..6c9bfff885f2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/BmcKeySetsUpdateSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BmcKeySet; +import com.azure.resourcemanager.networkcloud.models.KeySetUser; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BmcKeySets Update. */ +public final class BmcKeySetsUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/BmcKeySets_Patch.json + */ + /** + * Sample code: Patch baseboard management controller key set of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchBaseboardManagementControllerKeySetOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + BmcKeySet resource = + manager + .bmcKeySets() + .getWithResponse("resourceGroupName", "clusterName", "bmcKeySetName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withExpiration(OffsetDateTime.parse("2022-12-31T23:59:59.008Z")) + .withUserList( + Arrays + .asList( + new KeySetUser() + .withAzureUsername("userABC") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")), + new KeySetUser() + .withAzureUsername("userXYZ") + .withDescription("Needs access for troubleshooting as a part of the support team") + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..38592a280f35 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksCreateOrUpdateSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.azure.resourcemanager.networkcloud.models.EndpointDependency; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CloudServicesNetworks CreateOrUpdate. */ +public final class CloudServicesNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Create.json + */ + /** + * Sample code: Create or update cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateCloudServicesNetwork( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .cloudServicesNetworks() + .define("cloudServicesNetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAdditionalEgressEndpoints( + Arrays + .asList( + new EgressEndpoint() + .withCategory("azure-resource-management") + .withEndpoints( + Arrays + .asList( + new EndpointDependency() + .withDomainName("https://storageaccountex.blob.core.windows.net") + .withPort(443L))))) + .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.java new file mode 100644 index 000000000000..8a55fe957daa --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksDeleteSamples.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.networkcloud.generated; + +/** Samples for CloudServicesNetworks Delete. */ +public final class CloudServicesNetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Delete.json + */ + /** + * Sample code: Delete cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .cloudServicesNetworks() + .delete("resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..301f9978b118 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for CloudServicesNetworks GetByResourceGroup. */ +public final class CloudServicesNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Get.json + */ + /** + * Sample code: Get cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .cloudServicesNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java new file mode 100644 index 000000000000..415da109475e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for CloudServicesNetworks ListByResourceGroup. */ +public final class CloudServicesNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListByResourceGroup.json + */ + /** + * Sample code: List cloud services networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listCloudServicesNetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.cloudServicesNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java new file mode 100644 index 000000000000..bbd29d6c1644 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for CloudServicesNetworks List. */ +public final class CloudServicesNetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_ListBySubscription.json + */ + /** + * Sample code: List cloud services networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listCloudServicesNetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.cloudServicesNetworks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java new file mode 100644 index 000000000000..ee24c80ab0d3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/CloudServicesNetworksUpdateSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetwork; +import com.azure.resourcemanager.networkcloud.models.CloudServicesNetworkEnableDefaultEgressEndpoints; +import com.azure.resourcemanager.networkcloud.models.EgressEndpoint; +import com.azure.resourcemanager.networkcloud.models.EndpointDependency; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for CloudServicesNetworks Update. */ +public final class CloudServicesNetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/CloudServicesNetworks_Patch.json + */ + /** + * Sample code: Patch cloud services network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchCloudServicesNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + CloudServicesNetwork resource = + manager + .cloudServicesNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "cloudServicesNetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAdditionalEgressEndpoints( + Arrays + .asList( + new EgressEndpoint() + .withCategory("azure-resource-management") + .withEndpoints( + Arrays + .asList( + new EndpointDependency() + .withDomainName("https://storageaccountex.blob.core.windows.net") + .withPort(443L))))) + .withEnableDefaultEgressEndpoints(CloudServicesNetworkEnableDefaultEgressEndpoints.FALSE) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c8c1d1a9d835 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersCreateOrUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterManagers CreateOrUpdate. */ +public final class ClusterManagersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Create.json + */ + /** + * Sample code: Create or update cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateClusterManager( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusterManagers() + .define("clusterManagerName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withFabricControllerId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/fabricControllerName") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAnalyticsWorkspaceId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java new file mode 100644 index 000000000000..ddc29f9b5578 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for ClusterManagers Delete. */ +public final class ClusterManagersDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Delete.json + */ + /** + * Sample code: Delete cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers().delete("resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..fa851af14206 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for ClusterManagers GetByResourceGroup. */ +public final class ClusterManagersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Get.json + */ + /** + * Sample code: Get cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusterManagers() + .getByResourceGroupWithResponse( + "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java new file mode 100644 index 000000000000..374dacd847a8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for ClusterManagers ListByResourceGroup. */ +public final class ClusterManagersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListByResourceGroup.json + */ + /** + * Sample code: List cluster managers for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClusterManagersForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java new file mode 100644 index 000000000000..41bb6b780ab3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for ClusterManagers List. */ +public final class ClusterManagersListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_ListBySubscription.json + */ + /** + * Sample code: List cluster managers for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClusterManagersForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusterManagers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java new file mode 100644 index 000000000000..6a7b00b5b8d9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClusterManagersUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ClusterManager; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterManagers Update. */ +public final class ClusterManagersUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterManagers_Patch.json + */ + /** + * Sample code: Patch cluster manager. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterManager(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + ClusterManager resource = + manager + .clusterManagers() + .getByResourceGroupWithResponse( + "resourceGroupName", "clusterManagerName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..df38eb69fe1a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersCreateOrUpdateSamples.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; +import com.azure.resourcemanager.networkcloud.models.ClusterType; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.ServicePrincipalInformation; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters CreateOrUpdate. */ +public final class ClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Create.json + */ + /** + * Sample code: Create or update cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .define("clusterName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) + .withAggregatorOrSingleRackDefinition( + new RackDefinition() + .withBareMetalMachineConfigurationData( + Arrays + .asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("AA1234") + .withRackSkuId( + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData( + Arrays + .asList( + new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) + .withAnalyticsWorkspaceId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/microsoft.operationalInsights/workspaces/logAnalyticsWorkspaceName") + .withClusterType(ClusterType.SINGLE_RACK) + .withClusterVersion("1.0.0") + .withNetworkFabricId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/fabricName") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withClusterLocation("Foo Street, 3rd Floor, row 9") + .withClusterServicePrincipal( + new ServicePrincipalInformation() + .withApplicationId("12345678-1234-1234-1234-123456789012") + .withPassword("fakeTokenPlaceholder") + .withPrincipalId("00000008-0004-0004-0004-000000000012") + .withTenantId("80000000-4000-4000-4000-120000000000")) + .withComputeDeploymentThreshold( + new ValidationThreshold() + .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + .withType(ValidationThresholdType.PERCENT_SUCCESS) + .withValue(90L)) + .withComputeRackDefinitions( + Arrays + .asList( + new RackDefinition() + .withBareMetalMachineConfigurationData( + Arrays + .asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("AA1234") + .withRackSkuId( + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData( + Arrays + .asList( + new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName"))))) + .withManagedResourceGroupConfiguration( + new ManagedResourceGroupConfiguration().withLocation("East US").withName("my-managed-rg")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java new file mode 100644 index 000000000000..8c8dbdd887f2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Clusters Delete. */ +public final class ClustersDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Delete.json + */ + /** + * Sample code: Delete cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters().delete("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.java new file mode 100644 index 000000000000..f6f9ae362346 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersDeploySamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ClusterDeployParameters; +import java.util.Arrays; + +/** Samples for Clusters Deploy. */ +public final class ClustersDeploySamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy.json + */ + /** + * Sample code: Deploy cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deployCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .deploy( + "resourceGroupName", "clusterName", new ClusterDeployParameters(), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Deploy_SkipValidation.json + */ + /** + * Sample code: Deploy cluster skipping validation. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deployClusterSkippingValidation( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .deploy( + "resourceGroupName", + "clusterName", + new ClusterDeployParameters().withSkipValidationsForMachines(Arrays.asList("bmmName1")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..621279048df7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersGetByResourceGroupSamples.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.networkcloud.generated; + +/** Samples for Clusters GetByResourceGroup. */ +public final class ClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Get.json + */ + /** + * Sample code: Get cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getCluster(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..ce5df842b6df --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Clusters ListByResourceGroup. */ +public final class ClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListByResourceGroup.json + */ + /** + * Sample code: List clusters for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClustersForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java new file mode 100644 index 000000000000..3ba3bc4f16ce --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Clusters List. */ +public final class ClustersListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_ListBySubscription.json + */ + /** + * Sample code: List clusters for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listClustersForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.clusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java new file mode 100644 index 000000000000..927d22d47c35 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateSamples.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.BareMetalMachineConfigurationData; +import com.azure.resourcemanager.networkcloud.models.Cluster; +import com.azure.resourcemanager.networkcloud.models.RackDefinition; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceConfigurationData; +import com.azure.resourcemanager.networkcloud.models.ValidationThreshold; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdGrouping; +import com.azure.resourcemanager.networkcloud.models.ValidationThresholdType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class ClustersUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_Location.json + */ + /** + * Sample code: Patch cluster location. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterLocation(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withClusterLocation("Foo Street, 3rd Floor, row 9") + .apply(); + } + + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_Patch_AggregatorOrSingleRackDefinition.json + */ + /** + * Sample code: Patch cluster AggregatorOrSingleRackDefinition. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchClusterAggregatorOrSingleRackDefinition( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Cluster resource = + manager + .clusters() + .getByResourceGroupWithResponse("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withAggregatorOrSingleRackDefinition( + new RackDefinition() + .withBareMetalMachineConfigurationData( + Arrays + .asList( + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:FF") + .withBootMacAddress("00:BB:CC:DD:EE:FF") + .withMachineDetails("extraDetails") + .withMachineName("bmmName1") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX"), + new BareMetalMachineConfigurationData() + .withBmcCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withBmcMacAddress("AA:BB:CC:DD:EE:00") + .withBootMacAddress("00:BB:CC:DD:EE:00") + .withMachineDetails("extraDetails") + .withMachineName("bmmName2") + .withRackSlot(2L) + .withSerialNumber("BM1219YYY"))) + .withNetworkRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkRacks/networkRackName") + .withRackLocation("Foo Datacenter, Floor 3, Aisle 9, Rack 2") + .withRackSerialNumber("newSerialNumber") + .withRackSkuId( + "/subscriptions/subscriptionId/providers/Microsoft.NetworkCloud/rackSkus/rackSkuName") + .withStorageApplianceConfigurationData( + Arrays + .asList( + new StorageApplianceConfigurationData() + .withAdminCredentials( + new AdministrativeCredentials() + .withPassword("fakeTokenPlaceholder") + .withUsername("username")) + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceName("vmName")))) + .withComputeDeploymentThreshold( + new ValidationThreshold() + .withGrouping(ValidationThresholdGrouping.PER_CLUSTER) + .withType(ValidationThresholdType.PERCENT_SUCCESS) + .withValue(90L)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java new file mode 100644 index 000000000000..424fc7f8e847 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ClustersUpdateVersionSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ClusterUpdateVersionParameters; + +/** Samples for Clusters UpdateVersion. */ +public final class ClustersUpdateVersionSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Clusters_UpdateVersion.json + */ + /** + * Sample code: Update cluster version. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void updateClusterVersion(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .clusters() + .updateVersion( + "resourceGroupName", + "clusterName", + new ClusterUpdateVersionParameters().withTargetClusterVersion("2.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..97c9b486addc --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesCreateOrUpdateSamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Consoles CreateOrUpdate. */ +public final class ConsolesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Create.json + */ + /** + * Sample code: Create or update virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateVirtualMachineConsole( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .define("default") + .withRegion("location") + .withExistingVirtualMachine("resourceGroupName", "virtualMachineName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterManagerExtendedLocationName") + .withType("CustomLocation")) + .withEnabled(ConsoleEnabled.TRUE) + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withExpiration(OffsetDateTime.parse("2022-06-01T01:27:03.008Z")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.java new file mode 100644 index 000000000000..b3833be480ee --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesDeleteSamples.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.networkcloud.generated; + +/** Samples for Consoles Delete. */ +public final class ConsolesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Delete.json + */ + /** + * Sample code: Delete virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .delete("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.java new file mode 100644 index 000000000000..215376611723 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesGetSamples.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.networkcloud.generated; + +/** Samples for Consoles Get. */ +public final class ConsolesGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Get.json + */ + /** + * Sample code: Get virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByResourceGroupSamples.java new file mode 100644 index 000000000000..bb8acd584f0f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Consoles ListByResourceGroup. */ +public final class ConsolesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_ListByResourceGroup.json + */ + /** + * Sample code: List virtual machine consoles for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVirtualMachineConsolesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .consoles() + .listByResourceGroup("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.java new file mode 100644 index 000000000000..1a0262d0fe81 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/ConsolesUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.Console; +import com.azure.resourcemanager.networkcloud.models.ConsoleEnabled; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Consoles Update. */ +public final class ConsolesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Consoles_Patch.json + */ + /** + * Sample code: Patch virtual machine console. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVirtualMachineConsole(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Console resource = + manager + .consoles() + .getWithResponse("resourceGroupName", "virtualMachineName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withEnabled(ConsoleEnabled.TRUE) + .withExpiration(OffsetDateTime.parse("2022-06-01T01:27:03.008Z")) + .withSshPublicKey(new SshPublicKey().withKeyData("fakeTokenPlaceholder")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a373a7669d31 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksCreateOrUpdateSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.BgpPeer; +import com.azure.resourcemanager.networkcloud.models.CniBgpConfiguration; +import com.azure.resourcemanager.networkcloud.models.CommunityAdvertisement; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DefaultCniNetworks CreateOrUpdate. */ +public final class DefaultCniNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Create.json + */ + /** + * Sample code: Create or update default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateDefaultCNINetwork( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .defaultCniNetworks() + .define("defaultCniNetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withL3IsolationDomainId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName") + .withVlan(12L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withCniBgpConfiguration( + new CniBgpConfiguration() + .withBgpPeers(Arrays.asList(new BgpPeer().withAsNumber(64497L).withPeerIp("203.0.113.254"))) + .withCommunityAdvertisements( + Arrays + .asList( + new CommunityAdvertisement() + .withCommunities(Arrays.asList("64512:100")) + .withSubnetPrefix("192.0.2.0/27"))) + .withServiceExternalPrefixes(Arrays.asList("192.0.2.0/28")) + .withServiceLoadBalancerPrefixes(Arrays.asList("192.0.2.16/28"))) + .withIpAllocationType(IpAllocationType.DUAL_STACK) + .withIpv4ConnectedPrefix("203.0.113.0/24") + .withIpv6ConnectedPrefix("2001:db8:0:3::/64") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksDeleteSamples.java new file mode 100644 index 000000000000..42461458f62a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksDeleteSamples.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.networkcloud.generated; + +/** Samples for DefaultCniNetworks Delete. */ +public final class DefaultCniNetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Delete.json + */ + /** + * Sample code: Delete default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteDefaultCNINetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .defaultCniNetworks() + .delete("resourceGroupName", "defaultCniNetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d5cac8998c42 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for DefaultCniNetworks GetByResourceGroup. */ +public final class DefaultCniNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Get.json + */ + /** + * Sample code: Get default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getDefaultCNINetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .defaultCniNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "defaultCniNetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksListByResourceGroupSamples.java new file mode 100644 index 000000000000..92e439405ff6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for DefaultCniNetworks ListByResourceGroup. */ +public final class DefaultCniNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListByResourceGroup.json + */ + /** + * Sample code: List default CNI networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listDefaultCNINetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.defaultCniNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksListSamples.java new file mode 100644 index 000000000000..03400682ab64 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for DefaultCniNetworks List. */ +public final class DefaultCniNetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_ListBySubscription.json + */ + /** + * Sample code: List default CNI networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listDefaultCNINetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.defaultCniNetworks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksUpdateSamples.java new file mode 100644 index 000000000000..b0f277927902 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/DefaultCniNetworksUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.DefaultCniNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DefaultCniNetworks Update. */ +public final class DefaultCniNetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/DefaultCniNetworks_Patch.json + */ + /** + * Sample code: Patch default CNI network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchDefaultCNINetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + DefaultCniNetwork resource = + manager + .defaultCniNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "defaultCniNetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..321cccf236ff --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersCreateOrUpdateSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for HybridAksClusters CreateOrUpdate. */ +public final class HybridAksClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Create.json + */ + /** + * Sample code: Create or update Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .define("hybridAksClusterName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAssociatedNetworkIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")) + .withControlPlaneCount(4L) + .withHybridAksProvisionedClusterId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridContainerService/provisionedClusters/hybridAksClusterName") + .withWorkerCount(8L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersDeleteSamples.java new file mode 100644 index 000000000000..48b62606ff9a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for HybridAksClusters Delete. */ +public final class HybridAksClustersDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Delete.json + */ + /** + * Sample code: Delete Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .delete("resourceGroupName", "hybridAksClusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e6fa9546f039 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for HybridAksClusters GetByResourceGroup. */ +public final class HybridAksClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Get.json + */ + /** + * Sample code: Get Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .getByResourceGroupWithResponse( + "resourceGroupName", "hybridAksClusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..e209b7217c9e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for HybridAksClusters ListByResourceGroup. */ +public final class HybridAksClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListByResourceGroup.json + */ + /** + * Sample code: List Hybrid AKS provisioned clusters data for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listHybridAKSProvisionedClustersDataForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.hybridAksClusters().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersListSamples.java new file mode 100644 index 000000000000..3422f65e25e2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for HybridAksClusters List. */ +public final class HybridAksClustersListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_ListBySubscription.json + */ + /** + * Sample code: List Hybrid AKS provisioned clusters data for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listHybridAKSProvisionedClustersDataForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.hybridAksClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersRestartNodeSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersRestartNodeSamples.java new file mode 100644 index 000000000000..a3cd15e21a19 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersRestartNodeSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.HybridAksClusterRestartNodeParameters; + +/** Samples for HybridAksClusters RestartNode. */ +public final class HybridAksClustersRestartNodeSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_RestartNode.json + */ + /** + * Sample code: Restart a Hybrid AKS cluster node. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void restartAHybridAKSClusterNode( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .hybridAksClusters() + .restartNode( + "resourceGroupName", + "hybridAksClusterName", + new HybridAksClusterRestartNodeParameters().withNodeName("nodeName"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersUpdateSamples.java new file mode 100644 index 000000000000..fcd2e854010e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/HybridAksClustersUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.HybridAksCluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for HybridAksClusters Update. */ +public final class HybridAksClustersUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/HybridAksClusters_Patch.json + */ + /** + * Sample code: Patch Hybrid AKS provisioned cluster data. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchHybridAKSProvisionedClusterData( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + HybridAksCluster resource = + manager + .hybridAksClusters() + .getByResourceGroupWithResponse( + "resourceGroupName", "hybridAksClusterName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..137f5a916da3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksCreateOrUpdateSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L2Networks CreateOrUpdate. */ +public final class L2NetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Create.json + */ + /** + * Sample code: Create or update L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l2Networks() + .define("l2NetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withL2IsolationDomainId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withHybridAksPluginType(HybridAksPluginType.DPDK) + .withInterfaceName("eth0") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java new file mode 100644 index 000000000000..2c6b6403af32 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for L2Networks Delete. */ +public final class L2NetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Delete.json + */ + /** + * Sample code: Delete L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l2Networks().delete("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9546763abcd7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksGetByResourceGroupSamples.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.networkcloud.generated; + +/** Samples for L2Networks GetByResourceGroup. */ +public final class L2NetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Get.json + */ + /** + * Sample code: Get L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l2Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java new file mode 100644 index 000000000000..e3872f588525 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for L2Networks ListByResourceGroup. */ +public final class L2NetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListByResourceGroup.json + */ + /** + * Sample code: List L2 networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL2NetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l2Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java new file mode 100644 index 000000000000..215eeb9fdc78 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for L2Networks List. */ +public final class L2NetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_ListBySubscription.json + */ + /** + * Sample code: List L2 networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL2NetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l2Networks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java new file mode 100644 index 000000000000..4ecda1006e7d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L2NetworksUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.L2Network; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L2Networks Update. */ +public final class L2NetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L2Networks_Patch.json + */ + /** + * Sample code: Patch L2 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchL2Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + L2Network resource = + manager + .l2Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l2NetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..cff4891fe2ef --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksCreateOrUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksIpamEnabled; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import com.azure.resourcemanager.networkcloud.models.IpAllocationType; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L3Networks CreateOrUpdate. */ +public final class L3NetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Create.json + */ + /** + * Sample code: Create or update L3 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l3Networks() + .define("l3NetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withL3IsolationDomainId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName") + .withVlan(12L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withHybridAksIpamEnabled(HybridAksIpamEnabled.TRUE) + .withHybridAksPluginType(HybridAksPluginType.DPDK) + .withInterfaceName("eth0") + .withIpAllocationType(IpAllocationType.DUAL_STACK) + .withIpv4ConnectedPrefix("198.51.100.0/24") + .withIpv6ConnectedPrefix("2001:db8::/64") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java new file mode 100644 index 000000000000..ea18f9cab7e0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for L3Networks Delete. */ +public final class L3NetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Delete.json + */ + /** + * Sample code: Delete L3 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l3Networks().delete("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e800527c828c --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksGetByResourceGroupSamples.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.networkcloud.generated; + +/** Samples for L3Networks GetByResourceGroup. */ +public final class L3NetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Get.json + */ + /** + * Sample code: Get L3network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getL3network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .l3Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java new file mode 100644 index 000000000000..d731014e5ab8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for L3Networks ListByResourceGroup. */ +public final class L3NetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListByResourceGroup.json + */ + /** + * Sample code: List L3 networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL3NetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l3Networks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java new file mode 100644 index 000000000000..de4837cf1533 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for L3Networks List. */ +public final class L3NetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_ListBySubscription.json + */ + /** + * Sample code: List L3 networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listL3NetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.l3Networks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java new file mode 100644 index 000000000000..1963abd36389 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/L3NetworksUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.L3Network; +import java.util.HashMap; +import java.util.Map; + +/** Samples for L3Networks Update. */ +public final class L3NetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/L3Networks_Patch.json + */ + /** + * Sample code: Patch L3 network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchL3Network(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + L3Network resource = + manager + .l3Networks() + .getByResourceGroupWithResponse("resourceGroupName", "l3NetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a7eeb7b1d5e9 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MetricsConfigurations CreateOrUpdate. */ +public final class MetricsConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Update.json + */ + /** + * Sample code: Update metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void updateMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .define("default") + .withRegion("location") + .withExistingCluster("resourceGroupName", "clusterName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withCollectionInterval(15L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withEnabledMetrics(Arrays.asList("metric1", "metric2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..887fdb56b1a2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for MetricsConfigurations Delete. */ +public final class MetricsConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Delete.json + */ + /** + * Sample code: Delete metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .delete("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java new file mode 100644 index 000000000000..c6d0731bb40a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for MetricsConfigurations Get. */ +public final class MetricsConfigurationsGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Get.json + */ + /** + * Sample code: Get metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..332d33673ddf --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for MetricsConfigurations ListByResourceGroup. */ +public final class MetricsConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_ListByResourceGroup.json + */ + /** + * Sample code: List metrics configurations of cluster for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listMetricsConfigurationsOfClusterForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .metricsConfigurations() + .listByResourceGroup("resourceGroupName", "clusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..e488b29e7bd7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/MetricsConfigurationsUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ClusterMetricsConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for MetricsConfigurations Update. */ +public final class MetricsConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/ClusterMetricsConfigurations_Patch.json + */ + /** + * Sample code: Patch metrics configuration of cluster. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchMetricsConfigurationOfCluster( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + ClusterMetricsConfiguration resource = + manager + .metricsConfigurations() + .getWithResponse("resourceGroupName", "clusterName", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withCollectionInterval(15L) + .withEnabledMetrics(Arrays.asList("metric1", "metric2")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java new file mode 100644 index 000000000000..b3c761442519 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Operations_List.json + */ + /** + * Sample code: List resource provider operations. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listResourceProviderOperations( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java new file mode 100644 index 000000000000..526c45e990b4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for RackSkus Get. */ +public final class RackSkusGetSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_Get.json + */ + /** + * Sample code: Get rack SKU resource. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getRackSKUResource(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.rackSkus().getWithResponse("rackSkuName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java new file mode 100644 index 000000000000..2a487821d493 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RackSkusListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for RackSkus List. */ +public final class RackSkusListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/RackSkus_ListBySubscription.json + */ + /** + * Sample code: List rack SKUs for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listRackSKUsForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.rackSkus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..dc508f0472e8 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksCreateOrUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Racks CreateOrUpdate. */ +public final class RacksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Create.json + */ + /** + * Sample code: Create or update rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .racks() + .define("rackName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAvailabilityZone("1") + .withRackLocation("Rack 28") + .withRackSerialNumber("RACK_SERIAL_NUMBER") + .withRackSkuId("RACK-TYPE-1") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java new file mode 100644 index 000000000000..75d63a19b524 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Racks Delete. */ +public final class RacksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Delete.json + */ + /** + * Sample code: Delete rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.racks().delete("resourceGroupName", "rackName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6fecef9f075d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksGetByResourceGroupSamples.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.networkcloud.generated; + +/** Samples for Racks GetByResourceGroup. */ +public final class RacksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Get.json + */ + /** + * Sample code: Get rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .racks() + .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java new file mode 100644 index 000000000000..f9f1ef6e3bb0 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Racks ListByResourceGroup. */ +public final class RacksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListByResourceGroup.json + */ + /** + * Sample code: List racks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listRacksForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.racks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java new file mode 100644 index 000000000000..abdcbac1ff08 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Racks List. */ +public final class RacksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_ListBySubscription.json + */ + /** + * Sample code: List racks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listRacksForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.racks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.java new file mode 100644 index 000000000000..44ca80765395 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/RacksUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.Rack; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Racks Update. */ +public final class RacksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Racks_Patch.json + */ + /** + * Sample code: Patch rack. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchRack(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Rack resource = + manager + .racks() + .getByResourceGroupWithResponse("resourceGroupName", "rackName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withRackLocation("Rack 2B") + .withRackSerialNumber("RACK_SERIAL_NUMBER") + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..bfe64b0b3949 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesCreateOrUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.AdministrativeCredentials; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAppliances CreateOrUpdate. */ +public final class StorageAppliancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Create.json + */ + /** + * Sample code: Create or update storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .define("storageApplianceName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAdministratorCredentials( + new AdministrativeCredentials().withPassword("fakeTokenPlaceholder").withUsername("adminUser")) + .withRackId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withRackSlot(1L) + .withSerialNumber("BM1219XXX") + .withStorageApplianceSkuId("684E-3B16-399E") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.java new file mode 100644 index 000000000000..cb6f728cc600 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDeleteSamples.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.networkcloud.generated; + +/** Samples for StorageAppliances Delete. */ +public final class StorageAppliancesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Delete.json + */ + /** + * Sample code: Delete storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .delete("resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java new file mode 100644 index 000000000000..8d797444b304 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesDisableRemoteVendorManagementSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for StorageAppliances DisableRemoteVendorManagement. */ +public final class StorageAppliancesDisableRemoteVendorManagementSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_DisableRemoteVendorManagement.json + */ + /** + * Sample code: Turn off remote vendor management for storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void turnOffRemoteVendorManagementForStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .disableRemoteVendorManagement( + "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java new file mode 100644 index 000000000000..ecdb9ad2ea5d --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesEnableRemoteVendorManagementSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.StorageApplianceEnableRemoteVendorManagementParameters; +import java.util.Arrays; + +/** Samples for StorageAppliances EnableRemoteVendorManagement. */ +public final class StorageAppliancesEnableRemoteVendorManagementSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_EnableRemoteVendorManagement.json + */ + /** + * Sample code: Turn on remote vendor management for storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void turnOnRemoteVendorManagementForStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .enableRemoteVendorManagement( + "resourceGroupName", + "storageApplianceName", + new StorageApplianceEnableRemoteVendorManagementParameters() + .withSupportEndpoints(Arrays.asList("10.0.0.0/24")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6d92cce9c2ff --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for StorageAppliances GetByResourceGroup. */ +public final class StorageAppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Get.json + */ + /** + * Sample code: Get storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .getByResourceGroupWithResponse( + "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java new file mode 100644 index 000000000000..fa5a680af754 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for StorageAppliances ListByResourceGroup. */ +public final class StorageAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListByResourceGroup.json + */ + /** + * Sample code: List storage appliances for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listStorageAppliancesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.storageAppliances().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java new file mode 100644 index 000000000000..81d525f860a4 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for StorageAppliances List. */ +public final class StorageAppliancesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ListBySubscription.json + */ + /** + * Sample code: List storage appliances for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listStorageAppliancesForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.storageAppliances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesRunReadCommandsSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesRunReadCommandsSamples.java new file mode 100644 index 000000000000..b075a78b9541 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesRunReadCommandsSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.StorageApplianceCommandSpecification; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceRunReadCommandsParameters; +import java.util.Arrays; + +/** Samples for StorageAppliances RunReadCommands. */ +public final class StorageAppliancesRunReadCommandsSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_RunReadCommands.json + */ + /** + * Sample code: Run and retrieve output from read only commands on storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void runAndRetrieveOutputFromReadOnlyCommandsOnStorageAppliance( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .runReadCommands( + "resourceGroupName", + "storageApplianceName", + new StorageApplianceRunReadCommandsParameters() + .withCommands(Arrays.asList(new StorageApplianceCommandSpecification().withCommand("AlertList"))) + .withLimitTimeSeconds(60L), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java new file mode 100644 index 000000000000..6cab410202db --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.StorageAppliance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageAppliances Update. */ +public final class StorageAppliancesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_Patch.json + */ + /** + * Sample code: Patch storage appliance. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchStorageAppliance(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + StorageAppliance resource = + manager + .storageAppliances() + .getByResourceGroupWithResponse( + "resourceGroupName", "storageApplianceName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).withSerialNumber("BM1219XXX").apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesValidateHardwareSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesValidateHardwareSamples.java new file mode 100644 index 000000000000..5a18047c6ffa --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/StorageAppliancesValidateHardwareSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.StorageApplianceHardwareValidationCategory; +import com.azure.resourcemanager.networkcloud.models.StorageApplianceValidateHardwareParameters; + +/** Samples for StorageAppliances ValidateHardware. */ +public final class StorageAppliancesValidateHardwareSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/StorageAppliances_ValidateHardware.json + */ + /** + * Sample code: Validate the storage appliance hardware. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void validateTheStorageApplianceHardware( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .storageAppliances() + .validateHardware( + "resourceGroupName", + "storageApplianceName", + new StorageApplianceValidateHardwareParameters() + .withValidationCategory(StorageApplianceHardwareValidationCategory.BASIC_VALIDATION), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..325a38bbac1a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksCreateOrUpdateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TrunkedNetworks CreateOrUpdate. */ +public final class TrunkedNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Create.json + */ + /** + * Sample code: Create or update trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateTrunkedNetwork( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .trunkedNetworks() + .define("trunkedNetworkName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withIsolationDomainIds( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/l2IsolationDomainName", + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName")) + .withVlans(Arrays.asList(12L, 14L)) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withHybridAksPluginType(HybridAksPluginType.DPDK) + .withInterfaceName("eth0") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java new file mode 100644 index 000000000000..2737f9e90f29 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for TrunkedNetworks Delete. */ +public final class TrunkedNetworksDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Delete.json + */ + /** + * Sample code: Delete trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks().delete("resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..722ec978a1d3 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for TrunkedNetworks GetByResourceGroup. */ +public final class TrunkedNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Get.json + */ + /** + * Sample code: Get Trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .trunkedNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java new file mode 100644 index 000000000000..63c00bd7a8f1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for TrunkedNetworks ListByResourceGroup. */ +public final class TrunkedNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListByResourceGroup.json + */ + /** + * Sample code: List Trunked networks for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listTrunkedNetworksForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java new file mode 100644 index 000000000000..873ffa04ed59 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for TrunkedNetworks List. */ +public final class TrunkedNetworksListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_ListBySubscription.json + */ + /** + * Sample code: List trunked networks for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listTrunkedNetworksForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.trunkedNetworks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java new file mode 100644 index 000000000000..f97ebc2da9aa --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/TrunkedNetworksUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.TrunkedNetwork; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TrunkedNetworks Update. */ +public final class TrunkedNetworksUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/TrunkedNetworks_Patch.json + */ + /** + * Sample code: Patch trunked network. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchTrunkedNetwork(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + TrunkedNetwork resource = + manager + .trunkedNetworks() + .getByResourceGroupWithResponse( + "resourceGroupName", "trunkedNetworkName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesAttachVolumeSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesAttachVolumeSamples.java new file mode 100644 index 000000000000..1711086f27ba --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesAttachVolumeSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; + +/** Samples for VirtualMachines AttachVolume. */ +public final class VirtualMachinesAttachVolumeSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_AttachVolume.json + */ + /** + * Sample code: Attach volume to virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void attachVolumeToVirtualMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .attachVolume( + "resourceGroupName", + "virtualMachineName", + new VirtualMachineVolumeParameters() + .withVolumeId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..4886f5bfd0d2 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesCreateOrUpdateSamples.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.DefaultGateway; +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.NetworkAttachment; +import com.azure.resourcemanager.networkcloud.models.OsDisk; +import com.azure.resourcemanager.networkcloud.models.OsDiskCreateOption; +import com.azure.resourcemanager.networkcloud.models.OsDiskDeleteOption; +import com.azure.resourcemanager.networkcloud.models.SshPublicKey; +import com.azure.resourcemanager.networkcloud.models.StorageProfile; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineBootMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineDeviceModelType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineIpAllocationMethod; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHint; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHintPodAffinityScope; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePlacementHintType; +import com.azure.resourcemanager.networkcloud.models.VirtualMachineSchedulingExecution; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachines CreateOrUpdate. */ +public final class VirtualMachinesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Create.json + */ + /** + * Sample code: Create or update virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateVirtualMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .define("virtualMachineName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withAdminUsername("username") + .withCloudServicesNetworkAttachment( + new NetworkAttachment() + .withAttachedNetworkId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName") + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC)) + .withCpuCores(2L) + .withMemorySizeGB(8L) + .withStorageProfile( + new StorageProfile() + .withOsDisk( + new OsDisk() + .withCreateOption(OsDiskCreateOption.EPHEMERAL) + .withDeleteOption(OsDiskDeleteOption.DELETE) + .withDiskSizeGB(120L)) + .withVolumeAttachments( + Arrays + .asList( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"))) + .withVmImage("myacr.azurecr.io/foobar:latest") + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withBootMethod(VirtualMachineBootMethod.UEFI) + .withNetworkAttachments( + Arrays + .asList( + new NetworkAttachment() + .withAttachedNetworkId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName") + .withDefaultGateway(DefaultGateway.TRUE) + .withIpAllocationMethod(VirtualMachineIpAllocationMethod.DYNAMIC) + .withIpv4Address("198.51.100.1") + .withIpv6Address("2001:0db8:0000:0000:0000:0000:0000:0000") + .withNetworkAttachmentName("netAttachName01"))) + .withNetworkData("bmV0d29ya0RhdGVTYW1wbGU=") + .withPlacementHints( + Arrays + .asList( + new VirtualMachinePlacementHint() + .withHintType(VirtualMachinePlacementHintType.AFFINITY) + .withResourceId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName") + .withSchedulingExecution(VirtualMachineSchedulingExecution.HARD) + .withScope(VirtualMachinePlacementHintPodAffinityScope.fromString("")))) + .withSshPublicKeys(Arrays.asList(new SshPublicKey().withKeyData("fakeTokenPlaceholder"))) + .withUserData("dXNlckRhdGVTYW1wbGU=") + .withVmDeviceModel(VirtualMachineDeviceModelType.T2) + .withVmImageRepositoryCredentials( + new ImageRepositoryCredentials() + .withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java new file mode 100644 index 000000000000..127d1164b196 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines Delete. */ +public final class VirtualMachinesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Delete.json + */ + /** + * Sample code: Delete virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().delete("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDetachVolumeSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDetachVolumeSamples.java new file mode 100644 index 000000000000..c2d9db4787f7 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesDetachVolumeSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.VirtualMachineVolumeParameters; + +/** Samples for VirtualMachines DetachVolume. */ +public final class VirtualMachinesDetachVolumeSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_DetachVolume.json + */ + /** + * Sample code: Detach volume from virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void detachVolumeFromVirtualMachine( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .detachVolume( + "resourceGroupName", + "virtualMachineName", + new VirtualMachineVolumeParameters() + .withVolumeId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..acc09b0dafe5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines GetByResourceGroup. */ +public final class VirtualMachinesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Get.json + */ + /** + * Sample code: Get virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java new file mode 100644 index 000000000000..3802869b45fc --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines ListByResourceGroup. */ +public final class VirtualMachinesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListByResourceGroup.json + */ + /** + * Sample code: List virtual machines for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVirtualMachinesForResourceGroup( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java new file mode 100644 index 000000000000..8e0cbcbaaa84 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines List. */ +public final class VirtualMachinesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_ListBySubscription.json + */ + /** + * Sample code: List virtual machines for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVirtualMachinesForSubscription( + com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java new file mode 100644 index 000000000000..c3ee165fe54a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesPowerOffSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.SkipShutdown; +import com.azure.resourcemanager.networkcloud.models.VirtualMachinePowerOffParameters; + +/** Samples for VirtualMachines PowerOff. */ +public final class VirtualMachinesPowerOffSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_PowerOff.json + */ + /** + * Sample code: Power off virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void powerOffVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .virtualMachines() + .powerOff( + "resourceGroupName", + "virtualMachineName", + new VirtualMachinePowerOffParameters().withSkipShutdown(SkipShutdown.TRUE), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java new file mode 100644 index 000000000000..22b7c8db12a6 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesReimageSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines Reimage. */ +public final class VirtualMachinesReimageSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Reimage.json + */ + /** + * Sample code: Reimage virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void reimageVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().reimage("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java new file mode 100644 index 000000000000..e0a2a1a6de5e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesRestartSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines Restart. */ +public final class VirtualMachinesRestartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Restart.json + */ + /** + * Sample code: Restart virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void restartVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().restart("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java new file mode 100644 index 000000000000..bc259b42aa3f --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesStartSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for VirtualMachines Start. */ +public final class VirtualMachinesStartSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Start.json + */ + /** + * Sample code: Start virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void startVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.virtualMachines().start("resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java new file mode 100644 index 000000000000..dc18823b2043 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VirtualMachinesUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ImageRepositoryCredentials; +import com.azure.resourcemanager.networkcloud.models.VirtualMachine; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VirtualMachines Update. */ +public final class VirtualMachinesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/VirtualMachines_Patch.json + */ + /** + * Sample code: Patch virtual machine. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVirtualMachine(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + VirtualMachine resource = + manager + .virtualMachines() + .getByResourceGroupWithResponse( + "resourceGroupName", "virtualMachineName", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .withVmImageRepositoryCredentials( + new ImageRepositoryCredentials() + .withPassword("fakeTokenPlaceholder") + .withRegistryUrl("myacr.azurecr.io") + .withUsername("myuser")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1bb81dbc18e5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesCreateOrUpdateSamples.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.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes CreateOrUpdate. */ +public final class VolumesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Create.json + */ + /** + * Sample code: Create or update volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void createOrUpdateVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .volumes() + .define("volumeName") + .withRegion("location") + .withExistingResourceGroup("resourceGroupName") + .withExtendedLocation( + new ExtendedLocation() + .withName( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName") + .withType("CustomLocation")) + .withSizeMiB(10000L) + .withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java new file mode 100644 index 000000000000..e9527ba0e74e --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Volumes Delete. */ +public final class VolumesDeleteSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Delete.json + */ + /** + * Sample code: Delete volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void deleteVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.volumes().delete("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..8729fd2378c1 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesGetByResourceGroupSamples.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.networkcloud.generated; + +/** Samples for Volumes GetByResourceGroup. */ +public final class VolumesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Get.json + */ + /** + * Sample code: Get volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void getVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager + .volumes() + .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b7f2156603d5 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Volumes ListByResourceGroup. */ +public final class VolumesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListByResourceGroup.json + */ + /** + * Sample code: List volumes for resource group. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVolumesForResourceGroup(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.volumes().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java new file mode 100644 index 000000000000..d4cd4afa1739 --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +/** Samples for Volumes List. */ +public final class VolumesListSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_ListBySubscription.json + */ + /** + * Sample code: List volume for subscription. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void listVolumeForSubscription(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + manager.volumes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java new file mode 100644 index 000000000000..d60fc3446a6a --- /dev/null +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/src/samples/java/com/azure/resourcemanager/networkcloud/generated/VolumesUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.networkcloud.generated; + +import com.azure.resourcemanager.networkcloud.models.Volume; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes Update. */ +public final class VolumesUpdateSamples { + /* + * x-ms-original-file: specification/networkcloud/resource-manager/Microsoft.NetworkCloud/preview/2022-12-12-preview/examples/Volumes_Patch.json + */ + /** + * Sample code: Patch volume. + * + * @param manager Entry point to NetworkCloudManager. + */ + public static void patchVolume(com.azure.resourcemanager.networkcloud.NetworkCloudManager manager) { + Volume resource = + manager + .volumes() + .getByResourceGroupWithResponse("resourceGroupName", "volumeName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "myvalue1", "key2", "myvalue2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/networkcloud/ci.yml b/sdk/networkcloud/ci.yml new file mode 100644 index 000000000000..cd7e151450f5 --- /dev/null +++ b/sdk/networkcloud/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.yml + - sdk/networkcloud/azure-resourcemanager-networkcloud/ + exclude: + - sdk/networkcloud/pom.xml + - sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.yml + - sdk/networkcloud/azure-resourcemanager-networkcloud/ + exclude: + - sdk/networkcloud/pom.xml + - sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml + +parameters: + - name: release_azureresourcemanagernetworkcloud + displayName: azure-resourcemanager-networkcloud + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: networkcloud + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-networkcloud + groupId: com.azure.resourcemanager + safeName: azureresourcemanagernetworkcloud + releaseInBatch: ${{ parameters.release_azureresourcemanagernetworkcloud }} diff --git a/sdk/networkcloud/pom.xml b/sdk/networkcloud/pom.xml new file mode 100644 index 000000000000..df409a90cf4b --- /dev/null +++ b/sdk/networkcloud/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-networkcloud-service + pom + 1.0.0 + + + azure-resourcemanager-networkcloud + +